This may be a stupid question but how does the sizeof operator know the size of an array operand when you don\'t pass in the amount of elements in the array. I know it does
Sizeof is a compile time operator; it has as much information as the compiler does. (And obviously the compiler does know the size of the array).
Sizeof
This is why if you call sizeof on a pointer you get the width of the pointer, not the size of the array to which that pointer points.
sizeof