开发者

difference between enumerated and structure in c language? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be r开发者_JS百科eopened, visit the help center. Closed 12 years ago.

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜