Question: Non-converting type cast - example: In C interpret the bits in an integer as a float: int n; float f; ... f =*((float *) &n);
Non-converting type cast - example:
In C interpret the bits in an integer as a float:
int n;
float f;
...
f =*((float *) &n); // can achieve this effect with pointers
Write a small fragment of code that shows how unions can be used in C to interpret the bits of a value of one type as if they represented a value of some other type (non-converting type cast)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
