Since I can't add comments just yet, here's my two cents in an answer:
If you only want to know if the memory is on the stack or heap, read the other answers, they are much more informed than me.
If you want to know exactly where the values are, you can always print the address:
printf("address at a[0] = %p\n", (void *)&a[0]);
printf("address at p[0] = %p\n", (void *)&p[0]);
where you will notice the same answer. But, then look at
printf("address at a[1] = %p\n", (void *)&a[1]);
printf("address at p[1] = %p\n", (void *)&p[1]);
Which is a fun little exercise.
Just for fun, run the following code and see what you get:
p[2] = 'a';
printf("a[0] is %d\n", a[0]);
printf("a[1] is %d\n", a[1]);
printf("p[2] is %d\n", p[2]);
putchar(p[2]);