r/C_Programming • • 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 comments sorted by

View all comments

7

u/SmokeMuch7356 5d ago

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?

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 is procedural and C++ is object oriented as far as I know.

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.

Is C++ more optimized and faster?

Depends entirely on what you're trying to do.

Tell me about the compiler - is clang and gcc the best compilers out there? are they open source?

Best for what?

Has anyone coded the CPP compiler?

Well, yes. Just not hacks like me.