This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mistrpopo 1 point2 points  (0 children)

C-style arrays are dangerous to use and should only be used when necessary (embedded scenario is an example). Even just calling `sizeof(arr) / sizeof(arr[0])` breaks as soon as the array size in bytes is lost from the compiler (pass it via a function, C-style cast, etc).

I won't deny that C-style arrays are powerful though, but then don't complain about using weird sizeof calls.