floatptr=(float*) intptr;

O

omariqbalnaru

Can anybody please explain to me what the statment

floatptr=(float*) intptr;

does?
 
B

Bo Persson

Can anybody please explain to me what the statment

floatptr=(float*) intptr;

does?

What happens here is that you tell the compiler that intptr is really
a pointer to a float. "Trust me, I know what I'm doing".

If you remove the cast, the compiler will tell you that the convertion
doesn't work. Adding the cast will not change that, it will just tell
the compiler to shut up.


Bo Persson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top