Why (and when) do I need to use parentheses after sizeof?

According to 6.5.3, there are two forms for sizeof as the following:

sizeof unary-expression
sizeof ( type-name )

Since arr in your code is a type-name, it has to be parenthesized.

Leave a Comment