Typecasting and Conversions
Recall that in C, typecasting can be done to force a conversion from one type to another:
float f = (float) 5;
C++ has a new syntax for doing the same thing:
float f = float(5);
Now, float is just a function. C++ lets us define our own casting funcs.
Previous slide
Next slide
Back to first slide
View graphic version