3 ms·
Interestingly though, compatibility in the reverse direction has actually gotten better over time. C99 allows variables to be declared at any point in a functio
by Calavar 2y ago
Interestingly though, compatibility in the reverse direction has actually gotten better over time. C99 allows variables to be declared at any point in a function. Before C99, the all variables up front rule used to be the single biggest reason that C-style C++ code wouldn't compile under a C compiler.
- flohofwoe 2y agoMany C compilers accepted this as non-standard extension already before C99 though (along with winged comments, and `for (int...)`). There is a lot of useful harmonization happening between the two languages (and mostly from the direction of C++ to C) From the perspective of a C coder, the one good thing about C++ is that it is basically the testing ground for new potential C features to figure out what works and doesn't work in realworld scenarios before the C standard is polluted too much with the ideas that don't work ;)