4 ms·
All of it. C++ is a superset of C.
by fctorial 5y ago
All of it. C++ is a superset of C.
- GeorgeTirebiter 5y agoOthers disagree: https://mcla.ug/blog/cpp-is-not-a-superset-of-c.html https://mcla.ug/blog/cpp-is-not-a-superset-of-c.html
- Arch-TK 5y agoYou don't really have to ask others. The C and C++ standard disagree, you can easily find instances of this disagreement if you just peruse them. The easiest example to find is the difference in behavior of the auto keyword or in how conversions from void * to something_else * are implicit in C not in C++. There's now also an extreme number of subtleties in terms of undefined behavior which differ between the languages.
- varajelle 5y agoAnd even if it was, the idioms would still be different. Even if yaml is a superset of JSON, you wouldn't apply JSON pattern (eg. Using a "_comment" key for comments) to yaml. And similarly, many of the JavaScript design pattern won't apply to typescript because it has language features instead of conventions.
- vram22 5y agoBjarne Stroustrup, C++ creator, disagrees, IIRC. Think I read it on his site. Edit: https://www.stroustrup.com/bs_faq.html#C-is-subset https://www.stroustrup.com/bs_faq.html#C-is-subset >Please note that "C" in the paragraphs above refers to Classic C and C89. C++ is not a descendant of C99; C++ and C99 are siblings.
- cozzyd 5y agofoo_t foo = {.bar=1} ; doesn't work in C++.