1 2 3 4 5 6 7 8 9 10 11 12
#include <stdio.h> void f(){} int main() { void (*p)() = f; printf("%x, %d\n%x, %d\n%x, %d\n%x, %d\n%x, %d\n", &f, sizeof(&f), f , sizeof f, *f, sizeof(*f), p , sizeof p, *p, sizeof(*p)); return 0; }
1 2 3
In function 'int main()': Line 7: error: ISO C++ forbids applying 'sizeof' to an expression of function type compilation terminated due to -Wfatal-errors.