Resources » Articles/Knowledge Sharing » General

Difference Between C# and C++


Posted Date: 02-Jan-2010  Last Updated:   Category: General    
Author: Member Level: Gold    Points: 10






Hello Friends,

Difference Between C# and C++ :-
Most of the C# features are similar to those of C++. However, C# provides various additional features that make it a more type –safe and web enabled language. Various points of different between C# and C++ are :
Classes in C# are defined are implemented at the same place and so there is no need for using header files.
C# does not use header files as it compiles directly from the source code to the executable code.

C# does not use semicolon at the end of class definition.

C# does not support pointers for manipulating data. However, they are used in codes declared as unsafe.

C# does not contain any default constructor.

Behaviour of the command line arguments is different in C# as compared to C++.

Abstract of C# cannot be implemented.

C# does not support macros.

Objects in C# can only be created using new keywords.

C# allows the switch statement to be used with string values.

C# does not support multiple inheritance.

Declaration of array is different in C# as compared to C++. Arrays in C# are of reference type while in C++ arrays are of value type.

C# does not support the header file,# include.

All the data types in C# are inherited from the object super class and therefore they are objects.

In C#, structs are of value type.

C# does not support the typed of statement.

C# supports native Boolean type and Boolean type data can be implicitly or explicitly cast to any data type except object.

C# does not support default arguments.

Difference Between C# And Java :-
C# and java are both used in web based programming. C#
Contains various features similar to java. However it contains various features different of java,
Which are
C# contains more primitive data types than java.

C# supports operator overloading while java does not supports operator overloading.

C# supports the strut type while java does not support.

AII data types in C# are strut.

C# provides more data types as compared to java.

C# provides better versioning than java.

C# allows parameters to be passed by reference by using the ref keyword where as java allows parameters to be passed by value.
C# allows variable number of parameters using the param keyword.

C# provides static constructors for initialization.

C# does not provide the break statement. The goto statement is used to achieve this.

Declaration of arrays is different in C# as compared to java.

The convention for java is to put one public class in each file and in fact, some compilers require this. C# allows any source file arrangement.

thanks,
Vinod Dussad


Did you like this resource? Share it with your friends and show your love!




Responses to "Difference Between C# and C++ "
Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Awards & Gifts
    Active Members
    TodayLast 7 Daysmore...

    ISC Technologies, Kochi - India. Copyright © All Rights Reserved.