#include <stdio.h> int main(void) { int i=1; char c = 'c'; float f = 1.0; double* p = &i; printf("%d\n",*(int*)p); p = &c; printf("%c\n",*(char*)p); p = &f; printf("%f\n",*(float*)p); return 0; } Success
Standard input is empty
prog.cpp: In function 'int main()':
prog.cpp:9:15: error: cannot convert 'int*' to 'double*' in initialization
double* p = &i;
^
prog.cpp:11:4: error: cannot convert 'char*' to 'double*' in assignment
p = &c;
^
prog.cpp:13:4: error: cannot convert 'float*' to 'double*' in assignment
p = &f;
^
prog.cpp: At global scope:
prog.cpp:18:1: error: 'Success' does not name a type
Success
^
Standard output is empty