When used on an array the sizeof operator will return its size in bytes. If you want the number of elements, you need to divide the size of the array by the size of one of its elements:
Some programmers use a macro to make the code more readable:
printf("size of my_array = %u\n", sizeof(my_array) / sizeof(my_array));
The sizeof operator will return the size of an array that is declared in the current scope. When used on a pointer, it will return the size of a pointer, which is 4 bytes on most 32bit platforms.
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)))
printf("size of my_array = %u\n", ARRAY_SIZE(my_array));