home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
datafiles
/
text
/
c_tutor
/
union1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-02-27
|
389b
|
19 lines
main()
{
union {
int value; /* This is the first part of the union */
struct {
char first; /* These two values are the second */
char second;
} half;
} number;
long index;
for (index = 12;index < 300000;index += 35231) {
number.value = index;
printf("%8x %6x %6x\n",number.value, number.half.first,
number.half.second);
}
}