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.
More Related Contents:
- Why isn’t the size of an array parameter the same as within main?
- C sizeof a passed array [duplicate]
- Are there any platforms where pointers to different types have different sizes?
- Why does sizeof(x++) not increment x?
- Why does a C-Array have a wrong sizeof() value when it’s passed to a function? [duplicate]
- sizeof() operator in if-statement
- What does the ‘array name’ mean in case of array of char pointers?
- Why is sizeof considered an operator?
- Using sizeof with a dynamically allocated array
- Why is this happening with the sizeof operator when comparing with a negative number? [duplicate]
- sizeof with a type or variable
- size of character array and size of character pointer
- Is dereferencing null pointer valid in sizeof operation [duplicate]
- In C, why is sizeof(char) 1, when ‘a’ is an int?
- What does sizeof without () do? [duplicate]
- How sizeof(array) works at runtime?
- How to get the string size in bytes?
- C – SizeOf Pointers
- C pointers and arrays/ ‘sizeof’ operator [duplicate]
- Sizeof vs Strlen
- Why do I get a warning every time I use malloc?
- sizeof single struct member in C
- Implementation of sizeof operator
- What’s sizeof(size_t) on 32-bit vs the various 64-bit data models?
- ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=] [duplicate]
- Reliably determine the number of elements in an array
- What decides the sizeof an integer?
- C -> sizeof string is always 8
- Size of pid_t, uid_t, gid_t on Linux
- Find size of array without using sizeof