Saturday, 24 May 2014

differences between C# and C++


1.   C# does not include header files and this is due to the reason that C# does not separate class definition from implementation.
2.   Class definition in C# does not end with semicolon.
3.   The first character of Main function in C# is capitalized.
The Main function must return either an int or void type value.
4.   Any uninitialized variable in C# is checked and an error message is displayed at compile time. In C++ any uninitialized variable remains undetected and later on causes unwanted output .
5.   C# permits declaration of variables between goto and label.
6.   Arrays differ in many aspects and behavior in C# as compared to C++.
7.   C# supports four iteration statements as compared to three of C++ . The fourth one included is foreach.
8.   The number of operators that can be overloaded in C# are less as compared to C++.
9.   C# does not provide any default for constructors.
10.                     In C# switch can be used on string values
11.                     Casting operations in C# are much safer than they are in C++.

12.                     Introduction of a keyword override. It is used while overriding a virtual function.

No comments:

Post a Comment