0
What is difference between C & C++ ??
3 Answers
0
C++ was invented to manage complexity that C could not handle. For example, a common problem with C was that you could "run out of names for variables" (not to be taken literally of course) because there was no encapsulation, namespaces etc.
Also, C does not have exceptions, therefore error handling is very error prone, since it depends on the library user to always check return values of functions, whereas with exceptions, the library developer simply throws an exception that guarantees program flow will be halted.
C++ helps by having the constructor init objects which is automatically called by compiler. Unlike C structs which need to be initialized by the programmer (hence another error-prone area).
Lastly, there is a lot of other advantages touted by OOP, such as object reuse as well the generic programming based concepts, such as templates and generics which allow you to reuse source code,etc.
+ 4
Sometimes search for your self became helpful.
see this
https://cs-fundamentals.com/tech-interview/c/difference-between-c-and-cpp
+ 2
C was invented first. It is a lower level language and requires you implement everything yourself. It is what is known as a procedural programming language. C++ came later. It is a hybrid lamguage: procedural and object oriented, rather than just a procedural language. Due to C++ having more tools, being slightly higher level, and having the ability to code in fewer lines, it is somewhat easier to learn. Hopefully, others can add more.