how to mask members in a union
i have a union
union filter_row
{
MAC_Filter MAC;
IP_Filter IP;
开发者_运维百科 TCP_Filter TCP;
UDP_Filter UDP;
ICMP_Filter ICMP;
ARP_Filter ARP;
};
The members of this union are structure....how to mask the members of structures... Do I have to initialize them to all 1's initially???
All members of a union share the same storage space, enough to accommodate the alignment and size of the largest and most restrictive of the members. Normally, you'd also require a member in the structure to indicate what union member to use.
精彩评论