JiiPee schreef op 18-Sep-14 1:22 PM:
> Okey, but I think that is more like a question that do we need C type
> arrays anymore at all?
>
> I mean if I am teaching C++ I would like to teach the correct way to do
> things. Using a C arrays would teach wrong ways to program C++ , isn't it?
That depends.
If you want to teach how things work at the lowest level (as opposed to
what one should use): when you get down to the implementation it is
still C-style arrays and pointers.
When programming in a resource-rich situation (for instance a PC) using
the STL and other standard libraries is definitely a good idea.
In a resource-constraint situation (for instance real-time work on a
small micro-controller) using the same libraries might be a bad idea
because they often use the heap (which you will likely not have), and
have an unpredictable timing. (The *average* performance is generally
very good, but that does not help at all in a strict real-time situation).
Wouter van Ooijen
(who happens to be teaching C++)