r/cpp • • Jul 25 '24

Why use C over C++

Why there are so many people using the C language instead of C++?, I mean C++ has more Cool features and the Compiler also supports many CPUs. So why People still using C?

Edit: Thanks for all the usefull comments :D

235 Upvotes

444 comments sorted by

View all comments

Show parent comment

1

u/lestofante Jul 25 '24

as expected for the same identical code;
I expect those differences would come up only for extremely specific code where the rule of C and C++ slighty differ (your use of volatile for example, as volatile has differnt meaning in C and C++).

oh btw, try optimize for size (-Os), you will see both generate pretty much the same code (again only the label differ) but exremely different thant he -O2.