getting return value from a int ?

Started by
5 comments, last by NightMarez 19 years, 7 months ago
Hi all, a little noobie question. lets say i got this int checkvalue() { int returnvalue = 10 return returnvalue; } and from another spot i do a call to it void hello() { checkvalue(); // return value how do i get it ? } how do i get the return value from checkvalue into my hello ?
Advertisement
int checkvalue(){  int returnvalue = 10;  return returnvalue;}void hello(){  int getvalue;  getvalue = checkvalue();}
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
here you go:

int GiveMeAnInt(){ int a = 10; return a;}void Hello(){ int x; x = GiveMeAnInt();}
QB 4 EVER
Mwaha! Type fast, make lots of errors, get my post listed first, and then edit it to make it look good. I'm sneaky! [evil]
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
[Pedantic mode = on]

It would look even better if it had a semicolon after

int returnvalue = 10

in the first function though.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley
You got me... Darn. Stupid quick copy/paste. *grumble-mumble*
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
thank you all :)

This topic is closed to new replies.

Advertisement