HOW C# IS DIFFERENT FROM C++ ?

C#` C++
WHAT DO WE MEAN BY
C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# is designed specifically to work with the .Net and is geared to the modern environment of Windows and mouse-controlled user interface, networks and the internet. C# aims to combine the high productivity of Visual Basic and the raw power of C++. C++ is a general-purpose programming language with high-level and low-level capabilities. It is a statically typed, free-form, multi-paradigm, usually compiled language supporting procedural programming, data abstraction, object-oriented programming, and generic programming.

ENVIRONMENT AND COMPILE TARGET C# was designed to be a somewhat higher-level component-oriented language. When compiled, C# code is converted into intermediate language code. This intermediate language code is converted into executable code through the process called Just-In-Time compilation. C++ was designed to be a low-level platform-neutral object-oriented programming language. When compiled, C++ code is converted into assembly language code.
MEMORY MANAGEMENT In C#, memory management is automatically handled by Garbage Collector. In C++, the memory that is allocated in the heap dynamically has to be explicitly deleted.
PROGRAM FLOW In C# switch statement, the test variable can be a string. In C# switch statement , when break statement is not given, the fall through will not happen to the next case statement if the current case statement has any code. In addition to for, while and do-while, C# has another flow control statement called for each. In C++ Switch Statement, the test variable cannot be a string. In C++ switch statement, when break statement is not given, the fall through will happen to the next case statement even if the current case statement has any code. C++ does not contain any for each statement.
ACCESS MODIFIERS The access modifiers in C# are public, private, protected, internal and protected internal. The access modifiers in C++ are public, private and protected only.
EXCEPTIONS C# has finally block in exception handling mechanism. The code statements in the finally block will be executed once irrespective of exception occurrence. The exception in C# can only throw a class that is derived from the System.Exception class. C++ does not have finally block in exception handling mechanism. It can also throw exception of any class.
DELEGATES – SUBSTITUTE OF POINTER C# does not have the concept of function pointers. It has a similar concept called Delegates. C++ supports the concept of function pointer.
  • MAKE A DREAM CAREER IN .NET , JAVA, Android, PHP, SEO,

    Cloud Computing, C, C++, Data Structure

    CALL @ 08860352748, 01165164822

    or

    http:// www.cpd-india.com

Your email address will not be published. Required fields are marked *

Contact CPD Technologies






    [recaptcha]