Hacker News new | ask | show | jobs
by kazinator 2675 days ago
> C++ is not a superset of C

C++ contains a subset which is a dialect of C that is so compatible with C (in particular C90) that you can write code in it that compiles as C, and with very little effort. (Which I know from extensive personal experience, not just theory).

(Such code benefits from the extra checks and diagnostics C++ provide; and with some #ifdef switching and macros, it can take advantage of some additional C++ diagnostic fatures when being compiled as C++.)

Quotes from Bjarne Stroustrup's C++ FAQ:

"Well written C tends to be legal C++ also."

"It is not uncommon to be able to convert tens of thousands of lines of ANSI C to C-style C++ in a few hours. "