Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Q: type cast

Status
Not open for further replies.

ralphtan

Technical User
Oct 15, 2002
15
SG
Anyone know how can I perfrom a type cast
where

float ptr;
short ptr2;

...

ptr2 = ptr;

can I do this way? if not, what is the proper way to do it? Thanks
 
Best creeate an error check but this: ptr2 =(short)ptr;
should work in a perfect world with a good compiler.
It works with gcc.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top