Computer Science Canada

Transferring value from one fucntion to a variable?

Author:  JR [ Fri Oct 15, 2004 8:45 am ]
Post subject:  Transferring value from one fucntion to a variable?

ok i have this function which does the menu.

code:

//menu
int menu()
{
int choice;
cout<<"Enter your choice\n";
cout<<"1. Addition\n2. Subtraction\n3. Multiplication\n4. Quit\n";
cin>>choice;
return (choice);
}


now the fucntion returns the choice which is 1-4.

now i want to put the choice only the number into another function, how to do it? When i try to put something like answer(x,y,menu()) it will put some different nubmers which is wrong.

Author:  wtd [ Fri Oct 15, 2004 2:25 pm ]
Post subject: 

code:
x = menu(y);


: