Header File (Array)

This is a discussion on Header File (Array) within the C Programming forums, part of the General Programming Boards category; I need all of these arrays to be included in a header file all_enum_types.h and its going to be used ...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    1

    Header File (Array)

    I need all of these arrays to be included in a header file all_enum_types.h and its going to be used in another program.
    I've got the editor open to the actual header file I just need to know what it is actually going to look like. I'm a total beginner in C.
    I've got this so far but I need the middle part (where the dots are):
    Code:
    #ifndef all_enum_types_h
    #define all_enum_types_h
    .
    .
    .
    #endif
    Arrays:
    Code:
    typedef enum {
    a, b, c, d, e, f, g, h, i
    } letter_commands_t;
    
    typedef enum {
    type_one, type_two, type_three, type_four, type_five, type_six,
    type_seven, type_eight
    } type_t;
    
    typedef enum {
    thing_one, thing_two, thing_three, thing_four, thing_five, thing_six
    } thing_t;

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    546
    your enum declarations are ok. just move them to the middle of your include file, after '#define' and before '#endif'. p.s. they are not arrays, they are enum declarations. arrays are a different thing.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2-D Array Initialization error (Header File)
    By anudeep2011 in forum C++ Programming
    Replies: 5
    Last Post: 01-13-2012, 11:12 AM
  2. Static float array in header file
    By kotoko in forum C++ Programming
    Replies: 5
    Last Post: 06-15-2009, 11:54 AM
  3. Replies: 30
    Last Post: 06-19-2006, 12:35 AM
  4. Including header file with in the header file
    By Arafat_211184 in forum C Programming
    Replies: 13
    Last Post: 12-19-2005, 09:03 AM
  5. Replies: 4
    Last Post: 12-14-2005, 01:21 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21