5 ms·
C++ was once a near superset of C. However, due to language divergence, the situation is that both C and C++ are large supersets of an intersection. What is in
by kazinator 7y ago
C++ was once a near superset of C. However, due to language divergence, the situation is that both C and C++ are large supersets of an intersection.
What is in that intersection depends on which C and C++ dialect pair your intersect.
E.g. a newer C++11 dialect has "long long", so if intersected with C99, "long long" is in the dialect. If we intersect C++ older than C++11 with C, or C older than C99 with C++, then we don't have "long long".
(Except as a conforming extension from a compiler, which we could detect with a configure script and use anyway.)
The thing is that the intersection languages are basically fully fledged C: you can easily develop in them and do everything you'd want from C, if you're willing to live without a few frills here and there like C99 designated initializers, and variable length arrays (dropped from being required in C in C11) and whatnot.
If you require complex numbers, that could get hairy.
A long-time C90 programmer will not find anything amiss, though.