Google
 
Webcprogramming.com




An Affiliate of AIHorizon




C-Style Typecast

C-style typecasts are available in both C and C++, but are considered poor C++ style because they are not as noticeable or precise as the C++ casts. C-style casts can be used to convert any type into any other type, potentially with unsafe results (such as casting an integer into a pointer type).
(<type>)<value>
This example casts an int to a double for the purpose of avoiding truncation due to integer division:
double result = (double)4/5;

-----
Interested in advertising with us?
Please read our privacy policy.
Copyright © 1997-2005 Cprogramming.com. All rights reserved.

Geodesy Designs