2 ms·
The previous poster wrote in his 3rd paragraph "There is a place for old C style low level features, but those should come later, after the safer concepts are
by johannes1234321 9y ago
The previous poster wrote in his 3rd paragraph
"There is a place for old C style low level features, but those should come later, after the safer concepts are already ingrained."
And I agree that teaching idiomatic C++ is important and C stuff is an extension.
If replacing vector with a C array gives you 20-30% my general assumption is that vector was used wrongly and there were too many copies happening and passing a pointer around avoided them.
And yes, when teaching pure C++ students will also easily create too many copies, but that's better than all the buffer overflows, null pointer dereferences etc. happening to students of C. Such bugs cause frustration, but students need results which give satisfaction.