difference between enumerated and structure in c language? [closed]
difference between enumerated and structure.
Well, there's a big difference.
Enumerations do not have members or attributes.
Structures do not define lists of constants. A structure can contain enumerations, but an enumeration cannot contain structures.
A structure:
struct Test {
int a;
float b;
char c;
};
An enumeration (enum):
enum fruits {
APPLE,
ORANGE = 3,
PEAR
};
Is this an interview question?
精彩评论