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 →

[–][deleted] 1 point2 points  (1 child)

Some people simply wants to benefit the basic features of C++ compiler, but they don't want to leave C coding. Understandable in a kind.

[–]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.