Thank you ^___^
i talked to you (kung) in xfire, and at this ime i understood this snippit:
Code:
float x = 10.3;
void *p;
p = (float *)&x;
*(float *)p = 100.001;
but for now, i dont get the 3rd line..
p is a void* and gets an address assigned from a floating point number, which is casted to a float*
a void* can contain a float* without any troubles? (yh, maybe the compiler knows how to handle this, but i want to learn how to do it correctly)
if i initialise a void* p; on startup, does p always stay a void* or is this possible = (int *)p; to cast the variable itself to another pointer-type? (same with normal types: int i = 1; i = (float)i
i just re-read you answer:
Code:
int i = 4;
printf("%d", *&*&*&*&i); // prints 4
// thats the same:
printf("%d", *(int *)&*&i); // 4
i assume on here that (int *)&i == &i am i correct?
and if so, thn on my first example (float *)&x == &x means, &x still is a float* and thn there is no need for doing a cast b4?
yh, i know, ima N00b, but if youre willing to answer me, feel free to
have fun :'D