Using arrays over vectors is never convenient. If it is, you are doing something very wrong.
Yes. Complicated programs, lots of bugs and frustration.
It's akin to learning something by hand in...
Type: Posts; User: Elysia
Using arrays over vectors is never convenient. If it is, you are doing something very wrong.
Yes. Complicated programs, lots of bugs and frustration.
It's akin to learning something by hand in...
Fixed.
It most certainly is, since it saves time, frustration and bugs, and it is what makes C++ C++. Otherwise you can just start off with C. What's the point? Low-level stuff is only necessary for the...
Pointer arithmetic.
*(p + n) = p[n]
I feel bad I missed that reply -_-
I blame it on not getting an email notification.
Of course. But do you have to understand how arrays work to use vector? No.
Do you have to understand how vectors and iterators work to create algorithms? Yes.
My point being that while you have to...
C++ has std::array and std::vector. C arrays be damned.
They're unsafe. You can't query their size. You can't get bounds checking. And they don't work well with all standard library functions...
Then you can just dump C++ and go C.
C arrays are not needed to learn C++.
Don't do that! Use std::vector.
Sheesh.
Use std::vector.
No. Global variables should be avoided.
Using them in this situation is even worse.
Use std::vector.
Better yet, pass the vector in to the function as a reference in order to avoid relying on...