In C programming language, array parameters are treated as pointers .So here we are passing base address of array a through function foo().
So the expression sizeof(a) will become sizeof (int *) which results in 4 or 8 depending on machine 32 bit or 64 bit.
Here it is mentioned that on 64 bit machine so it will return 8.