If your array is null terminated then you can iterate through the array and find the last value. Many string operators in C work that way
Otherwise you don't have much choice.
sizeof will return the size of p, which is a pointer and will equals to your int size