Welcome Guest ( Log In | Register )

Bump Topic Topic Closed RSS Feed
7 Pages « < 4 5 6 7 >Bottom

Outline · [ Standard ] · Linear+

University Multimedia University Thread V3, For any problems and discussions

views
     
wcypierre
post Nov 6 2011, 12:03 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 12:00 AM)
Err was force to get my hand onto C++ , previously i was a C programmer . But later on for robotic club i would have to program the IC using C language because of all the standard library function of C has been incorporated into it
*
yeah, those microcontrollers usually use C or ASM. Which I don't know at all =.=
wcypierre
post Nov 6 2011, 12:19 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
CODE

#include <iostream>

int main(){
std::cout << "Obviously" << std::endl;
std::cin.get();
std::cin.ignore();

return 0;
}


This post has been edited by wcypierre: Nov 6 2011, 12:21 AM
wcypierre
post Nov 6 2011, 12:37 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 12:27 AM)
Ok let me ask you what's the difference between cin.get() and cin.getline() , and what's the different between cin.getline() and getline(cin , ch) //ch a string class variable.
*
but I am not a pro coder wo. Noob noob only doh.gif

I only know the problem is because of the existing chars in buffer only sweat.gif

This post has been edited by wcypierre: Nov 6 2011, 12:40 AM
wcypierre
post Nov 6 2011, 12:59 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 12:51 AM)
Why you choose IT at first one??Share experience
*
Because I love computing? tongue.gif . I had the passion in computing since child, playing with the programs and such. Then I started to learn programming since form 4 then till now lor.

p/s: c++ is not my native language so pardon me on my incompetence.
wcypierre
post Nov 6 2011, 01:04 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 01:02 AM)
what language you took??C++ ain't my first language too lol
*
From C to C++ is easier than Php to c++

I am not talking about first language, I mean language that you are familiar with.

This post has been edited by wcypierre: Nov 6 2011, 01:04 AM
wcypierre
post Nov 6 2011, 01:09 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 01:07 AM)
i see php , i also start from javascript . Anyway ECMAscript has almost similiar syntax and style as C and C++
*
I am not talking about the syntax and style. But what I meant is the programming logic. Programming logic is different. Codes that work in c++ will work in php but codes in php might not work in c++. I mean the basic functions.
wcypierre
post Nov 6 2011, 01:28 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 01:11 AM)
How it might differ??
*
For example,

CODE

#include <iostream>

void output(){
std::cout << var;
}

int main(){
int var = 111;
output();
return 0;
}


vs

CODE

<?php

function output(){
echo $var;
}

function main(){
$var = 111;
}

main();
output();

?>


In the c++ code, obviously it won't even compile because variable var has not been initialized yet. If you throw it below main, then it'll still won't compile since there is no function called output.
It gives you a feel of encapsulation, even though you're still coding in procedural style.

Meanwhile, in the PHP code, it will run no matter how you change the orders of the functions.

Another difference would be adding several variables with arrays into a bigger array. How to do that in c++(not that we can't, but we need more work to do it as compared with PHP).

In php, its relatively easy.

And quite a lot of other things as well, such as the question that you just asked me. We don't handle the internals in PHP(unless you're going hardcore), while you have to go deeper in c++(pointers).


wcypierre
post Nov 6 2011, 10:02 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 09:52 AM)
Yeah pointer , but the evolution of PHP not only make it become a web application language but also it can be use to compile into a standalone console program(before that when it's used in creating web application it's a interpreted language).
*
Even in php cli, you still don't need to handle much. But what I meant is not whether its a console apps or not. What I meant is the programming logic. It differs even though most style n syntax is derived from c/c++. Example, If you want to merge several variables with several data types into 1 variable, its not possible in c++, while its possible in php since the data will be autotype casted to its respective datatype.

p/s: The problem of from an easier language to a much harder language brows.gif
wcypierre
post Nov 6 2011, 03:04 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 02:57 PM)
You're trying to say it's a weakly typed language = =


Added on November 6, 2011, 2:57 pmand also implicit data type conversion
*
yeah. but still type casting what sweat.gif Since you're so good at it, now, show me how to put multiple variables with different data types into one variable and return it brows.gif brows.gif

This post has been edited by wcypierre: Nov 6 2011, 03:04 PM
wcypierre
post Nov 6 2011, 07:29 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 06:25 PM)
hmm??I thought just declare it , after that it's to your mean to put whatever type of value into it , and later on you can reassign it to another type?
*
Of course not. That one I still know how to do.

char var;
cout << int(var);

I mean something nearly like this:

int var1;
char var2;
string var 3;
bool var 4;

Try and combine these into 1 variable brows.gif brows.gif

wcypierre
post Nov 6 2011, 08:48 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
It IS typecasting. when did I said no? Yeah, structure is a valid method. But I think you didn't get my question from the beginning.
wcypierre
post Nov 7 2011, 12:03 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 6 2011, 09:56 PM)
What is your question can ellaborate more??
*
Just assume that I never asked.

QUOTE(Human Nature @ Nov 6 2011, 11:43 PM)
any engineering students here..let's discuss calculus  flex.gif
*
Not Engineering student, but discuss about what chapter eh? I want to improve my calculus also tongue.gif

wcypierre
post Nov 7 2011, 11:14 AM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 7 2011, 11:00 AM)
IT also got learn calculus lol , call discrete calculus
*
Not IT also got learn calculus, is Computer science has discrete maths.

IT != Computer Science
wcypierre
post Nov 7 2011, 12:01 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
IT != CS != SE dude.

Pure CS is more on maths, logics, algos(things that I kinda hate but still have to learn it anyway).
SE is more on application development(based on what I had read on a SE book)
well, IT, you know what its about.
wcypierre
post Nov 7 2011, 04:43 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 7 2011, 04:16 PM)
Well i've already say those name ain't important , it's depend on how the specific uni view it . Some uni say the course is CS but they focus more on programming
*
That's if its CS.

In CS, there are many majors.
SE is one of them. However, some uni do provide this as a standalone course.

The uni may focus more on programming if they have SE as one of their major.

I do agree that its uni dependant but do you still remember what's the initial question?
wcypierre
post Nov 7 2011, 06:34 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(kailoonthedog @ Nov 7 2011, 06:06 PM)
Yeah i say IT do learn discrete calculus , any wrong??
*
http://www.cs.ucf.edu/it/faq.html
http://www.ucti.edu.my/degree11.htm
http://www.limkokwing.net/lesotho/courses/...ion_technology/
http://www.handbook.uts.edu.au/courses/c10143.html
wcypierre
post Nov 7 2011, 08:05 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(teohzl @ Nov 7 2011, 08:04 PM)
I have a little suggestion here.

lets say you have 4 type which are int, char, double, float

1. Remember that your variable is declared in function which their memory will be reclaim once returned, but not erase. So the easy way will be return a pointer of the first variable you assign which is the "int", by then point to after int will give u the char, double, float and so on.

2. The actual way which is safe, is to use "malloc" and give it a sizeof(int+char+double+float) which will return u a pointer that can be returned and use. The pointer is a "void" pointer which you can use as anything, which allows u to determine how is it. But remember do use "free" once u finish or else memory leak might occur.
*
hmm, okay. I'll do a research on it later on notworthy.gif
wcypierre
post Nov 7 2011, 08:18 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(teohzl @ Nov 7 2011, 08:09 PM)
Errr... 1 more thing, malloc just allocate memory, you need to give it some value before return.
*
okay okay. No probs. Will get my butt working in c++ soon tongue.gif
wcypierre
post Nov 8 2011, 09:07 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(teohzl @ Nov 8 2011, 07:59 PM)
CS and software engineering is two big different thing.

REMEMBER, software is not programming, a piece of software consist of programmer, designer, composer, writer etc. SE will be the guy that manage a software from scratch till the end ( even recruit programmer, designer etc) and not about programming. A software engineer can programming ofcourse, but its not his main task and programming language is just like a foundation for him.

Same to CS which has its major part in its way but I don't know whats it.

So, basically, programming for CS and SE serve as foundation only but their major part has their own role. Thats why they both learn programming.


Added on November 8, 2011, 8:00 pm

Sorry mistake
*
I didn't said that its the same. I just said that some CS courses incorporate SE as one of their major. And I did said that some uni's provide SE as an independent course to imply that CS is not SE. What I actually meant is that CS and SE is correlated but not the same.

p/s: maybe there's misunderstanding or something, anyway, discussion is good though laugh.gif
wcypierre
post Nov 9 2011, 10:59 PM

Newbie Programmer
Group Icon
Elite
4,619 posts

Joined: Jul 2011
QUOTE(dr_zoidberg @ Nov 9 2011, 07:44 PM)
So far I visited the Engineering campus and the nearby, only two canteens I've found. Any other nice Chinese/Western/Malaysian-style foods served around the campus as well?
*
Check the previous few pages, you'll find something that will make your appetite 'grow' tongue.gif

7 Pages « < 4 5 6 7 >Top
Topic ClosedOptions
 

Change to:
| Lo-Fi Version
0.0477sec    0.38    7 queries    GZIP Disabled
Time is now: 8th December 2025 - 07:54 AM