prog.cpp: In function ‘int main()’:
prog.cpp:11:10: error: invalid conversion from ‘int (*)(int)’ to ‘int (*)()’ [-fpermissive]
ptr2 = func;
^
prog.cpp:13:69: error: ‘printf’ was not declared in this scope
printf("main関数のアドレス = %p, ptr1 = %p\n", main, ptr1);
^
prog.cpp: In function ‘int func(int)’:
prog.cpp:21:25: error: ‘printf’ was not declared in this scope
printf("x = %d\n", x);
^