How to / Where to use enum?

 

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; 
 
What errors are you getting?
 
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
 
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
 
enum menu7 {
   menu7_0, // Server >>
   menu7_1, // PC >>
   menu7_2, // GMT >>
};
input  menu7  TimeClock=menu7_2;
type in all including the symbols //
 
CurrencyEnum' - unexpected token
Stop there and look at the code above that line.
 
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
Reason: