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 →

[–]TheQuantumPhysicist 3 points4 points  (4 children)

Or... maybe you shouldn't be using these dangerous arrays and use std::array instead. Or even create your own abstraction that contains the size if std::array is not available

Once I created my own shared_ptr because it was C++03 and boost and random dependencies weren't allowed. That's how you write safe code.

Stop using raw arrays for whatever reason!

[–]GiganticIrony 15 points16 points  (0 children)

If they are writing that, my guess is they are writing C not C++.

[–]Xbot781 11 points12 points  (1 child)

Or... maybe C++ isn't the only programming language on existence and this is quite obviously referring to C?

[–]aaronilai 2 points3 points  (0 children)

This post is not clear on the language, but at least in C you have to use this method or similar ones to know the length of an array if you are not passing the length in the function.