I was reading through Relationship between C and C++ and was interested in a more technical look at the question.
For example, if you want to use threads in C++, would you (assuming a Linux platform) just use pthreads? I know C++ has the STL and the Boost libraries fill in a lot of gaps… but do C++ programmers generally use libraries for C code?
I’m trying to decide if it’s worth learning C++ as I already know C (admittedly learning C is not a pre-requisite and can be a disadvantage) but I’m not sure how C++ and C libraries etc all tie in together….
Up through C++03, yes, you’d probably use pthreads. The current draft of C++11 has threading built into the standard library, so you’d probably use that instead (though it’s based closely on pthreads, so there’s little practical difference between them).
In general, however, yes, it’s easy to use C libraries directly from C++, and in the absence of a C++ library for the purpose it’s common to use them. For that matter, even when there is a C++ library, some people sometimes prefer to use C libraries anyway.