In the C++ language, you can use the following methods to convert or cast data from one type to another.
- C styled casts
reinterpret_cast
dynamic_cast
static_cast
const_cast
In the standard C++ and C language, you can convert or "cast" similiar types of data. For instance:
char myInitial = 'N';
int myInitialAscii = (int)myInitial;
// OR
int myInitialAscii = int(myInitial); // Familiar to the python programmer
- Used with pointers and references
- or
void*
- or