so, my next question is a very fundamental question, and when i google it, i get weird results making me think that it might not be possible.. but that also seems strange!
how can you return a value from a function? so far, since i couldn't find the syntax to do it, i have been passing variables by reference and modifying them. can someone please show me the syntax to return a variable?
c++:
rettype funcname (params){
rettype a;
//operations;
return a;
}
i'm not sure how to state teh function should return this type of value, and what the syntax for returning is... when i google, i just keep getting a whole bunch of stuff on return on investment.. and nothing on returning variables.
how can you return a value from a function? so far, since i couldn't find the syntax to do it, i have been passing variables by reference and modifying them. can someone please show me the syntax to return a variable?
c++:
rettype funcname (params){
rettype a;
//operations;
return a;
}
i'm not sure how to state teh function should return this type of value, and what the syntax for returning is... when i google, i just keep getting a whole bunch of stuff on return on investment.. and nothing on returning variables.