home *** CD-ROM | disk | FTP | other *** search
/ Microsoftware Monthly 19…2 Programming Power Tools / MASO9512.ISO / cpptutor / cpptutor.arj / CH05 / A05261.WAV (.mp3) < prev    next >
Waveform Audio File Format  |  1993-10-20  |  358.8 KB  |  1 channel  |  11,025 sample rate  |  33 seconds
Transcription: You can use a union in specific circumstances. For instance, when you want to conserve storage and you never use more than one member of a class at a time, or when you want to interpret the same stored data as having more than one data type. The data members overwrite each other in memory and the size of a union is the size of its largest data member. As you can see, a union can have data members and member functions and private, protected or public members. By default, all members of a union are public.