Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 17th, 2006, 9:08 AM   #1
biohazard
Newbie
 
biohazard's Avatar
 
Join Date: Feb 2006
Posts: 18
Rep Power: 0 biohazard is on a distinguished road
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
biohazard is offline   Reply With Quote
Old Feb 17th, 2006, 6:52 PM   #2
sunnypalsingh
Programmer
 
sunnypalsingh's Avatar
 
Join Date: Dec 2005
Posts: 33
Rep Power: 0 sunnypalsingh is on a distinguished road
Read This
http://www.cprogramming.com/tutorial/enum.html
__________________
The only real valuable thing is intuition.
-Albert Einstein
sunnypalsingh is offline   Reply With Quote
Old Feb 17th, 2006, 7:01 PM   #3
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,261
Rep Power: 5 grumpy will become famous soon enough
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.
grumpy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC