> I want to get back into the programming scene so I have a question:
> Which should I relearn first, C or C++?
There is nothing that can be done with C that can't be done with C++; there is
nothing that can be done with C++ that can't be done with C. Having said that,
there are a number of important modern programming techniques (object-oriented
programming, generic programming, even to a limited extent functional
programming) that are massively easier to do in C++, and also massively easier
to do well. (*)
On the other hand, C++ is a much, much bigger and more complex language than C:
unlike C, it's almost impossible to know it thoroughly. That's not necessarily a
bad thing; most people know a large enough subset of C++ for their needs, and do
perfectly well with it.
It's true that many books and tutorials on C++ assume a prior knowledge of C, or
at least of that (smallish) part of C++ which is very similar to C. (It's worth
knowing that even though this subset exists, and even though it would be
perfectly possible to write entirely C-style programs in C++, almost every
significantly big C++ program is constructed and written in an entirely
different idiom to a C one). I'd say in general though that these books tutorial
are inferior to those which don't take the start-with-C route (Someone with a
more detailed knowledge than mine of the C++ book world should be able to
recommend something); an awful lot of the postings for help you'll see on this
newsgroup, for instance, come from people using the start-with-C route who've
started bumping into "proper C++" - templates, standard containers, generic
algorithms, proper polymorphism - and become hopelessly lost.
My advice to you is to learn C++ - for almost all applications it's more
powerful than C - but to do it properly. What I mean by that is, learn from a
source which starts you off straight away with proper standard containers and
only mentions arrays in passing; which is absolutely pedantic about what is and
isn't allowed, and what will cause "undefined behaviour"; which never requires
you to write, say a linked list, except for one single exercise late on in the
section on pointers and arrays (which should be late on in the book)...
Hope that helps,
Tom
(*) Note to nitpickers and C++ gurus: I'm well aware that there are some rather
esoteric things in C++ - template metaprogramming for instance - that can't
reasonably be done in C; and some more that don't directly translate. But for
the purposes of day-to-day programming, and certainly beginner programming, I
think my statement is broadly true.