How to / Where to use enum?

Back to topics list To post a new topic, please log in or register
avatar
273
sheriffonline 2015.01.05 06:47
 

Hi,

Question as above?

I tried some code here. but it shows many error!

can anyone show me exact example to use enum? i tried search googling, no use?

enum CurrencyEnum
  {
   EUR,  
   USD,  
   GBP, 
   AUD,
   Something_else  // Other currencies
   
  };
  
extern CurrencyEnum currency = EUR; 
avatar
Moderator
3406
GumRai 2015.01.05 10:00 #
 
What errors are you getting?
avatar
273
sheriffonline 2015.01.06 06:41 #
 
GumRai:
What errors are you getting?
CurrencyEnum' - unexpected token
currency' - expression on global scope not allowed
currency' - variable not defined
EUR' - expression on global scope not allowed
EUR' - variable not defined
enum' - expression on global scope not allowed
enum' - variable not defined
CurrencyEnum' - expression on global scope not allowed
CurrencyEnum' - variable not defined
{' - expression on global scope not allowed
'EUR' - variable not defined
'USD' - variable not defined
'GBP' - variable not defined
'AUD' - variable not defined

avatar
Moderator
3406
GumRai 2015.01.06 08:40 #
 
Look at the code above the code that you have posted, you have probably made an error there as ther is nothing wrong with your enum as far as I can tell
avatar
1172
sxTed 2015.01.06 08:41 #
 
enum menu7 {
   menu7_0, // Server >>
   menu7_1, // PC >>
   menu7_2, // GMT >>
};
input  menu7  TimeClock=menu7_2;
type in all including the symbols //
avatar
12985
WHRoeder 2015.01.06 17:38 #
 
CurrencyEnum' - unexpected token
Stop there and look at the code above that line.
avatar
118
Jimdandy 2015.01.06 20:08 #
 
Yes as WHRoeder mentioned, you need to look above the enum. Those errors seem to indicate that above that area you have some code that is either missing or has an extra closing bracket. With out seeing the code around your problem it's impossible to say. It has something to do with opening and closing a block of code. .... Happy Hunting! PipPip....Jimdandy
Back to topics list  

To add comments, please log in or register