![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Posts: 18
Rep Power: 0
![]() |
problem with defining enumeration variable
hi guys,
i am having problem with defining enumeration varaiable i have written the following code [code] cout<<"print enumeration"; cin>>money; [code] the problem is cin>>money; where money is the enumeration variable. could anybody tell me how to define an enumeration variable |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Dec 2005
Posts: 33
Rep Power: 0
![]() |
__________________
The only real valuable thing is intuition. -Albert Einstein |
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,209
Rep Power: 5
![]() |
enum's can't be printed directly. The usual technique is to convert them to an int (or, with a bit more work, to a string containing the names of values) and print that. And the reverse for reading data in.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|