C++ Casting Operators Explained With Simple Example
Type casting is the method to convert variable (or expression) of a type to another type. Casting operators are special operators which are used to convert variable of one data type to another data type. Type casting can be done in two ways:
Implicit casting is being done automatically where values are copied to another compatible type. Eg: int to long int or float etc.
Explicit casting is done specifically by the programmer. In C++ there are four types of casting operator available.
(more…)