Advantages of c++ over c language | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Advantages of c++ over c language

6th Jan 2017, 3:33 PM
Sumit Kanozia
Sumit Kanozia - avatar
7 Answers
+ 18
classes oop
6th Jan 2017, 3:48 PM
Frost
Frost - avatar
+ 4
C++ is indeed powerful , have rich library , etc... BUT it is NOT highly portable. Yes it is portable but no, it is not so easily portable. C++ can sometimes give you headaches while trying to cross-platform it. So people commonly use Java or Lua (maybe C#) for those cross-platform works. But people still do use C++ for cross-platform, but it is NOT common and easy to do so. Back to the question about the above statement, among the both of them, I would consider C as easier to cross-platform compared to C++. But thats just me
6th Jan 2017, 5:36 PM
Wen Qin
Wen Qin - avatar
+ 3
The best part according to me is the independency of declaring variable anywhere in the program and also access them without using any type specifiers.
6th Jan 2017, 8:15 PM
Rishabh Agrawal
Rishabh Agrawal - avatar
+ 2
C++ is a highly portable language and is often the language of choice for multi-device, multi-platform app development. C++ is an object-oriented programming language and includes classes, inheritance, polymorphism, data abstraction and encapsulation. C++ has a rich function library. C++ allows exception handling, and function overloading which are not possible in C. C++ is a powerful, efficient and fast language. It finds a wide range of applications – from GUI applications to 3D graphics for games to real-time mathematical simulations.
6th Jan 2017, 3:54 PM
Manikanta Nallamalli (Mittu)
Manikanta Nallamalli (Mittu) - avatar
+ 1
Ok the advantages of cpp over c is mainly not reinvent the whell approach. (libs for everything). I think the main advantage is the support of the community to language c++ community are better in general over c. Portabilility is a serious challenge of c++ just try to exec on other OS or other mobile device a guaranteed headcache.
6th Jan 2017, 11:16 PM
nextco
nextco - avatar
+ 1
Because of OOP support; c++ is more appropriate than C for very large projects.
8th Jan 2017, 6:44 AM
ifl
ifl - avatar
- 1
In C++ you can Use the standard library plus lambdas in the place of most C style loops. Never write the keyword "delete" through judicious use of std::shared_ptr, std::weak_ptr, and std::unique_ptr. Manage other resources via RAII and/or shared_ptrs with custom deleters and thus never have to manually grab and de-grab resources. Use runtime polymorphism where OOP is a natural fit for your application domain. Use compile time polymorphism (i.e. metaprogramming) in lieu of the sort of "cut-and-paste polymorphism" that large C projects invariably degenerate into. and do all of the above such that the compiled code is as fast or faster than it would be had it been written in C.
7th Jan 2017, 10:14 AM
Jayesh Patel
Jayesh Patel - avatar