C VS C++


Guys, Please anyone tell me,
What is the difference between C and C++ ??

What do you know about them already?
C provides support for procedural programming.
C++ additionally provides support for object oriented programming and user defined types.
There is a website called - "www.google.com". Write your question there and you will get some excellent answers.
C++ is a better C. It has amazing features like OOP.

OOP is not a feature. You can do OOP in C but C++ has a lot of features that makes OOP easier.
The sockets library is an example of an object oriented library written in C. The user is required to cast data structures back to sockaddr*, but you never actually use one. It's pretty bewildering to most folk, even long term users.

All of that is because C does not support the paradigm. So there is no language enforcement of concepts making it difficult to understand and difficult to use.

With C++, such an OO library can rely on the language to catch user type errors and present obvious code.
Last edited on
Also virtual functions + inheritance behavior is pain to simulate in C. Because C was not created with OOP in mind and does not support in (not that it cannot be done, just that there isn't anything which helps you with this).
Comparing C and C++ is pointless, because it is different languages. C++ has some backward compatibility with C, but code valid in C can be invalid in C++.
Each of languages has own uses: there isn't many people who will write huge GUI application in plain C, and use of C with microcontrollers is preferred over C++.
Topic archived. No new replies allowed.