- C++ is derived from C language. It is super set of C.
- Earlier C++ was known as C with classes.
- In C++, the major change was the addition of classes and a mechanism for inheriting class objects into other classes.
- Most C programs can be compiled in C++ compiler.
- C++ expressions are the same as C expressions.
- All C operators are valid in C++.
- C is procedural language whereas C++ is non procedural language i.e. object oriented language.
- No virtual functions are present in C. The concept of virtual functions are used in C++.
- In C, Polymorphism is not possible. The concept of polymorphism is used in C++.
- Operator overloading is not possible in C. Operator overloading is one of the greatest feature of C++.
- Top down approach is used in program design in C. Bottom up approach adopted in program design in C++.
- No namespace feature is present in C language. Namespace feature is present in C++ for avoiding name collision.
- Multiple declaration of global variables are allowed in C. Multiple declaration of global variables are not allowed in C++.
- In C, mapping between data and function is difficult and complicated. In C++, mapping between data and function can be used using 'objects'.
- In C, we can call main() function through other function. In C++, we can't call main() function through other function.
- C requires all the variables to be defined at the starting of a scope. C++ allows the declaration of variable anywhere in the scope i.e. at time of its first use.
- No inheritance is possible in C. Inheritance is possible in C++.
Sunday, June 7, 2020
Tags
About Rohan Raoul
Rohan Raoul is a blogger and the name of the blog is KNOWFACT.The main purpose of KNOWFACT is to provide the detail elaboration of nature related topics, exercise related topics, technology related topics and interesting facts.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment