Newbie Here - Return? Parameters?
I am very new to programming and am currently taking a c++ class.
I am a little confused as to what the parameters and return are.
I am currently working on how to use functions outside of "main" and as well as outside of the file.
So here it goes..
Does anyone know what I am doing wrong?
int myFunction(int whoAmI_1, int whoAmI_2) //Am I declaring these
//now? So they didnt
//exist till now?
int whoAmI_1 = 2;
int whoAmI_2 = 3;
inMain += wh0AmI_1; //how do I use this "inMain" from another
sendBack = whoAmI_1 + whoAmI_2;
//I know I am sending "sendBack" to the function it was called
//from right? If this is so than what are the parameters for at the
//top? Are those vars I am getting from another function?
// Also what if I want to send all of the variables back to main for
//further computation? can I return a few vars?
cout << myFunction(); //This should print out 5 because
//"myFunction" returned "sendBack" which
//is 4 right?
//What about the parameters I put in when I
//created the function? do i need those here?