C Struct Kinds

Use “c struct” to match all C Struct kinds

Kind Name
C Abstract Struct Type
C Private Member Struct Type
C Protected Member Struct Type
C Public Member Struct Type
C Struct Type
C Unknown Struct Type
C Unnamed Private Member Struct Type
C Unnamed Protected Member Struct Type
C Unnamed Public Member Struct Type
C Unnamed Struct Type
C Unresolved Struct Type
C Unresolved Private Member Struct Type
C Unresolved Protected Member Struct Type
C Unresolved Public Member Struct Type
C Unresolved Unnamed Struct Type

A struct type may be an ordinary struct, that is, not a member of a class.

struct mystruct {         // C Struct Type
  int field1;
  int field2;
  }; 

A struct may be unnamed. The following example shows an array of 10 elements containing a structure consisting of two int members

struct {                  // C Unnamed Struct Type
   int field1;
   int field2;
}myarray[10]; 

A struct may be a member of a class. In this case the struct may be private, protected, or public.

class A { 
  public: 
    struct mystruct{       // C Public Member Struct Type 
       int field1; 
       int field2; 
    }; 
} 

A struct may be an abstract struct, which is a struct with at least one pure virtual member function.

struct struct_abstract {    // C Abstract Struct Type
  int virtual mem1() = 0;
}; 

An unresolved struct is a struct that is known to exist but who’s definition is unknown. An unknown struct is an unresolved struct, but is also lacking any formal declaration.

extern struct a_struct;     // C Unresolved Struct Type 
typedef struct b_struct T;  // C Unknown Struct 

Scientific Toolworks, Inc.
http://www.scitools.com