Datasheet
/* Referring to declarations from the example above: */
pm = μ
mu.d = 4.016;
tmp = mu.d; // OK: mu.d = 4.016
tmp = mu.i; // peculiar result
pm->i = 3;
tmp = mu.i; // OK: mu.i = 3
The third line is legal, since mu.i is an integral type. However, the bit pattern in mu.i
corresponds to parts of the previously assigned double. As such, it probably won’t
provide an useful integer interpretation.
When properly converted, a pointer to a union points to each of its members, and
vice versa.
171
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5