[ create a new paste ] login | about

Link: http://codepad.org/JHHv8w5c    [ raw code | output | fork ]

minke - C++, pasted on Aug 24:
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;
}


Output:
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.


Create a new paste based on this one


Comments: