Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Transferring value from one fucntion to a variable?
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
JR




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Fri Oct 15, 2004 2:25 pm   Post subject: (No subject)

code:
x = menu(y);
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: