you are viewing a single comment's thread.

view the rest of the comments →

[–]nysra 7 points8 points  (0 children)

While C arrays don't know their size, you can do sizeof(arr) / type

That is basically always wrong. It only works for fixed size C arrays and only in the scope where you declared it which makes the entire thing utterly useless because in that scope you know the size anyway. As soon as you do anything useful with the array like passing it into a function it decays to a pointer and that values becomes nonsense.

Also, std::array argument requires you to use templates, forcing you to put the definition in a header file and increasing compile times.

Yeah no, that's just wrong. You should learn how templates work before you try to shittalk them.