C++/C Federation and enumeration

Source: Internet
Author: User

Union Union

1. The address of a union variable is the same as any member address of a union variable.

2. Union variables of the same type cannot be compared in size.

3. Constructors and destructors can be defined, but cannot have virtual and static member functions, and cannot be used as base or derived classes.

Enum enum

1. Enumerations can define the same values.

2. This value is unknown when the integer is strongly converted to an enumeration and exceeds the enumeration value.

3. Anonymous enumeration is equivalent to directly defining const symbolic constants.

A fixed size of int,c++ is not fixed in the 4.C language.

C++/C Federation and enumeration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.