The Memory Length occupied by struct variables is the total memory length occupied by each member. Each member occupies its own memory unit.
The Memory Length occupied by the shared body variable is equal to the longest member length.
Note:
1. the members that are last stored when a member plays a role in a shared object variable is saved to a new member, and the original members become ineffective.
2. You cannot take the shared body variable as a function parameter or bring the function back to the shared body variable, but you can use the pointer of the variable.
Enumeration type: Enum weekday {sun, Mon, Tue, WND, Thu, Fri, sat };
Note:
1. In C compilation, enumeration elements are processed according to constants, so enumeration constants are called. They are not variables and cannot be assigned values.
2. Enumeration elements are constants, which have values. C language compilation makes their values 0, 1, 2, and so on in the defined order ,....
You can also change the value of the enumerated element.ProgramSpecified by members, such:
Enum weekday {sun = 7, MON = 1, Tue, wed, Thu, Fri, sat} workday, week_end;
Define sun = 7, MON = 1, and then add 1 in sequence. Sat is 6.
3. An integer cannot be directly assigned to an enumerated variable.
Values can be assigned only when forced type conversion is performed. For example, workday = (Enum weekday) 2;