Not compiling without a decent level of warnings enabled, to at least inform you when you're doing something dumb.
Code:
$ gcc -Wall foo.c
foo.c: In function ‘main’:
foo.c:13:15: warning: statement with no effect [-Wunused-value]
( "Allocated memory!" );
^
foo.c:14:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
P = 10;
^
foo.c:15:22: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]
printf(" P = %d", P);
^
foo.c:18:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
printf(" P = %d", sizeof(P));
^
foo.c:20:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
printf(" P = %d", sizeof(P));
^
Fix the errors, then try again.