What is different between c# and c++
C# compiles straight from source code to executable code,
with no object files.
C# does not separate class definition from implementation.
Class are defined and implemented in the same place and therefore there is
no need for header files.
Command-line parameters array behave differently in c#
as compare to c++.
In c#, class definition does not use a semicolon at the end.
C# does not support multiple code inheritance.
Casting in c# is much safer than in c++.
When overriding a virtual method, we must use the override keyword.
Abstract methods in c# are similar to behave differently in
c# as compared to c##.
C# provides special syntax to initialize arrays efficiently.
Array in c# are always reference types rather than value
types, as they are in c++ and therefore stored in a heap.
In c#, switch can also be used on string values.
C# does not support the labeled break and therefore jumping out of nested loops can be messy.
The set of operators that can be overloaded in c# is smaller compared to c++.
C# does not provide any defaults for constructors.
Destructors in c# behave any defaults for constructors.
In c#, class and definition does not use a semicolon at the end.
The first characters of the Main() function is capitalized. The Main must return either int or void type value.
C# does not support #include statement. (Note that using is not the same as #include).
All the basic value types will have the same size on any system. This is not the case in c or c++. Thus c# is more suitable for writing distributed application.
In c#, data types belong to either value types (which are created in a stack) or reference types(which are created in a heap).
In c#, structs are value types.
C# checks for uninitialized variables and gives error massages at compile time. 23) In c++, an uninitialized variable goes undetected thus resulting in unpredictable output.
In c#, supports a native string type. Manipulation of strings are easily.