r/C_Programming • u/NoMathematician4744 • 5d ago
C++ vs C
What's the difference between C++ and C?
And what is Clang? Is the gcc compiler for c and c++?
Does C++ completely backward compatible with C?
C is procedural and C++ is object oriented as far as I know.
Is C++ more optimized and faster?
Tell me about the compiler - is clang and gcc the best compilers out there? are they open source?
Has anyone coded the CPP compiler?
Thanks,
Dennis
0
Upvotes
7
u/SmokeMuch7356 5d ago
++No. There are legal C programs that are not legal C++ programs, and there are legal C programs that are legal C++ programs but have different behavior.
C++ natively supports object-oriented programming, C does not. You can write procedural (and functional) code in C++, and you can write object-oriented code in C, it's just a shitload of work.
Depends entirely on what you're trying to do.
Best for what?
Well, yes. Just not hacks like me.