Mega Code Archive

 
Categories / C++ / Class
 

The reinterpret_cast operator converts one type into a fundamentally different type

#include <iostream> using namespace std;     int main() {   int i;   char *p = "This is a string";       i = reinterpret_cast<int> (p); // cast pointer to integer       cout << i;       return 0; }