C++ vs C#

C++Server Side ProgrammingProgramming

C++ Programming language

A successor of the c programming language that has introduced the concept of classes and objects. It encapsulates features of c and high-level language hence it can be treated as an intermediate-level language. When it was created it was thought of as a C that has classes because of its similarities with C.

C# Programming Language

C# (also known as C sharp) is a general-purpose programming language that was developed by Microsoft to run on .net framework for developing applications for its operating system. It is an object-oriented programming language with features like object-oriented, statically typed, decorative, multiparadigm programming language.

Both languages are quite popular and some similarities in them. These are some points of difference −

CompilationThe code of c++ will compile and converted to machine level code.The code of c# will be compiled and converted to intermediate code (CLR).
PlatformC++ programming language can be compiled and used in all platforms as it works on hardware.C# programming language is windows specific and is rarely used in platforms other than windows
Memory managementC++ programming language does not support automatic memory management. So, the programmer has to do it manually. i.e. delete the created object to free up memory spaceIn the c# programming language, an automatic memory management system is there. The garbage collector keeps track of memory management.
PointersIn c++ the use of pointers is valid anywhere in the program.In C#, the use of pointers is valid only in the unsafe mode of the programming language.
Easy of workingIn c++, the programmer needs good understanding of concepts and it has complex features.C# is easy to work on programming language die to its well-defined and easy understandable hierarchy of classes.
Type of languageC++ is a low level, object-oriented programming language.C# is a high-level object-oriented programming language.

C++ has primitive data types due to which it is not a pure object-oriented programming language.C# is a pure object-oriented programming language.
ApplicationC++ has found its usage in console applications.C# can be used to develop mobile, windows.
Updated on 19-Sep-2019 07:57:35