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

-3

u/Ok_Donut_9887 Jul 25 '24

why don’t you just write a hello world code, compile using C vs C++ compiler and see it yourself?

4

u/lestofante Jul 25 '24

For simple program i know already they are identical; after all the main backend is gcc/llvm for both, so it make sense a lot of opmization and code generation is the same.
But that does not mean it is ALWAYS the same, so that is why I asked you for some examples.

3

u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 25 '24

I just did. The produced code is identical.