Quote:
Originally posted by joe_bruin work? it's not even close to compiling.
try writing one function at a time, compiling, and testing it. don't go on until you've gotten it to work.
your first problem is dealing with scopes. for example, if you declare variables a, b, c, etc. in function getValues(), those variables no longer exist once that function has ended. so, that function isn't very useful for getting data, since the data it gets disappears once it's over. perhaps global variables would work better.
what's this supposed to do?
int& aa=a;
that's junk. don't do that.
try to fix it up, and come back to us with if you have any specific questions about why something doesn't work. |
its some **** my professor was telling us about called "reference variables" and the coding on this site showed that int& newname=name; is the correct coding for it... and that should allow variables to be accessed from outside of the function its located in...