structure errors - C

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samdomville
    New Member
    • Jul 2008
    • 10

    structure errors - C

    Hello - I have a structure which looks good to me:

    Code:
    typedef struct t_settings
    {
      :
      BOOL var1;
    
      Obj1 var2;
      :
    } settings;
    firstly, what is the "t_" before the structure name mean?

    also, I get an error saying syntax error before Obj1...and then a warning saying that no semicolon after struct or union. Why?

    Thanks!
    Sam
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    BOOL should be typedefed some where...
    What is the use of : in the structure.....

    Raghu

    Comment

    • samdomville
      New Member
      • Jul 2008
      • 10

      #3
      I put : there just to show that there is code above and after what I typed, but the compiler did not complain about them...please advise. thanks!

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        I see no type definition of Obj1 in the posted code, are you sure you have included the file where it is defined?

        The "t_" is nothing special, it is not uncommon to insert "t_" or "tag" before (or after) the structure name when typedefing a structure to differentiate it from the type name. On my current project we use a "s" prescript on the structure name and a "T" prescript on the typedef name.

        Comment

        Working...