I'm trying to complete an exercise that begins as follows:
Define a float variable. Take its address, cast that address
to an unsigned char, and assign it to an unsigned char
pointer. Using this pointer and [ ], index into the float
variable...
I'm fine up until the last sentence. I don't know what it means by index into the float. Could somebody clarify that?
Also, here's what I have of the program so far, in case something is wrong:
1 2 3 4 5 6 7 8 9 10
#include <iostream>
usingnamespace std;
typedefunsignedchar uchar;
int main(){
float f = 3.14;
uchar c = uchar(&f);
uchar* p = &c