int main() { void * voidPtr; // Assign to point to double voidPtr = new double(5.345); // Read double back cout << * ((double *) voidPtr) << endl; // Read double as int cout << * ((int *) voidPtr) << endl; // Delete pointer delete (int *) voidPtr; return 0; }