4 ms·
Pedantically you are correct, but it is and was common to use C++ compilers as a slightly more convenient dialect of C. This gives you the performance and simp
by lockhouse 3y ago
Pedantically you are correct, but it is and was common to use C++ compilers as a slightly more convenient dialect of C. This gives you the performance and simplicity of the C language with some very nice quality of life improvements.
With few exceptions, C++ can mostly be treated as a superset of C.
- jandrese 3y agoWhat I was trying to say is that if you're comfortable using modern C++ and try to switch back to a C++ compiler from the early 90s you are going to find a lot of the features you regularly use suddenly being absent. With C this is much less of an issue.
- lockhouse 3y agoSorry, I misread your comment, that makes a lot more sense now!
- duskwuff 3y agoThe newer C features that you're most likely to feel the lack of in an older compiler are: 1) Mixed declarations and code. All variables must be declared at the top of a basic block. 2) Along similar lines, declaring variables in control statements like for(). 3) // comments. (Hardly a critical feature, but you're probably used to having them.) Perhaps not coincidentally, I think these were all features which began their life in C++, and were backported to C in C99.
- ido 3y agoIIRC they were also available as “non-standard” feature in compilers at the time before being added to c99 (e.g. I’m pretty sure gcc in the late 90s supported all of these if you didn’t force c89 compatibility).