3 ms·
I can write code in C and consume it in C++ (through extern "C"). I can write code in C++ and consume it in C (through extern "C" again). C and C++ each have t
by vivegi 3y ago
I can write code in C and consume it in C++ (through extern "C").
I can write code in C++ and consume it in C (through extern "C" again).
C and C++ each have their own language idioms, just like other programming languages have their own.
There are usecases where you want to reuse code written in one language from within another. The evolution of C++ took a pragmatic look at this and provided mechanisms for that. If you are not using C++ or don't have that use case, that is fine. But language choice depends on a lot of other factors other than just pedantry.