Thread: enum error

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    22

    enum error

    Code:
        enum states { CALL_INIT, AUTHENTICATE, CARDLOOKUP, GETDEST, RATING, ROUTING, PLACECALL, LIVECALL, MAX_STATES } current_state;
        enum events { EVENT_1, MAX_EVENTS } new_event;
    
        
        void action_s1_e1 (void);
        void action_s2_e1 (void);
        void action_s3_e1 (void);
        void action_s4_e1 (void);
        void action_s5_e1 (void);
        void action_s6_e1 (void);
        void action_s7_e1 (void);
        void action_s8_e1 (void);
        enum events get_new_event (void);
        
    
        void (*const state_table [MAX_STATES][MAX_EVENTS]) (void) = {
        
        { action_s1_e1}, /* procedures for state 1 */
        { action_s2_e1}, /* procedures for state 2 */
        { action_s3_e1}, /* procedures for state 3 */
        { action_s4_e1}, /* procedures for state 4 */
        { action_s5_e1}, /* procedures for state 5 */
        { action_s6_e1}, /* procedures for state 6 */
        { action_s7_e1}, /* procedures for state 7 */
        { action_s8_e1}  /* procedures for state 8 */
        };
    This is the code I have as state_table.h.

    Why am I getting this error

    state_table.h:2:2: error: expected ';', identifier or '(' before 'enum'

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    What is included right before state_table.h wherever you are using it? The error might be in the file you include before this one.


    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    22
    Wow. That was it. I would never have guessed that

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Assigning enum types to enum types?
    By see the big C in forum C Programming
    Replies: 10
    Last Post: 12-21-2010, 02:32 AM
  2. i got some enum error cant find solution
    By noobnewrecruit in forum C++ Programming
    Replies: 3
    Last Post: 11-17-2010, 12:16 AM
  3. Odd enum error...
    By tjpanda in forum C++ Programming
    Replies: 2
    Last Post: 09-13-2008, 03:08 AM
  4. syntax error: enum and typedef struct
    By sagitt13 in forum C Programming
    Replies: 2
    Last Post: 10-31-2006, 04:17 PM
  5. compiler error with global enum
    By Mark S. in forum C++ Programming
    Replies: 3
    Last Post: 08-31-2006, 08:15 AM