+ 2
Advantages of c++ over c language
7 ответов
+ 18
classes oop
+ 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
+ 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.
+ 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.
+ 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.
+ 1
Because of OOP support; c++ is more appropriate than C for very large projects.
- 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.