Rated
Read 34,276 times
Contents
Related Categories
A comparison of C/C++ and C# - Comparison with C/C++
Comparison with C/C++
C# is directly related to C and C++. This is not just an idea, this is real.
As you recall C is a root for C++ and C++ is a superset of C. C and C++ shares
several syntax, library and functionality. In addition structures, unions, arrays,
strings and pointers are most important and similar functionality for both languages.
C# inherits most of its operators, keywords, and statements directly from C++.
Enums are clearly a meaningful concept in C++. Finally I can clearly say that
C# is the first component-oriented language in the C/C++ family. C# constructors
are very similar with C++ constructors. Like C++, methods are non-virtual by
default, but can be marked as virtual. There is also some difference between
C# and C++, C# supports multiple inheritance of interfaces, but not of classes.
Another difference is destructors, their syntax is same with C++ but actually
they are very different.
Most of the C# basic types have the same names as C++ basic types but they
are not really same. For example a char in C# is equivalent to a wchar_t in C++.
If you decide to move from C++ to C# there are a few things to watch out to include
the changes to new, structs, constructors, and destructors. Creating and using
a component (DLL) in C# is fairly easier than in C++. One more thing, Borland's
C++ Builder was a pure C++ with simple RAD environment of Delphi and VB. C++
Builder was not a new language. This is one of the biggest differences between
C++ Builder and C#. The CLR (Common Language Runtime) improves runtime interactivity
between program development simplicity, security and portability. However CLR
gives usability for cross-language integration. In addition to all those CLR
has a perfect foundation for a rich set of class libraries.
John H. GODEL has an experience more than 22 years in the area of software development. He is a software engineer and architect. His interests include object-oriented and distributed computing with C/C++, C#. Also he has several years of experience with COM, DCOM, COM+ and CORBA, software reuse, and object-oriented frameworks.
He has a bachelor’s degree in mathematical engineering and a master’s degree in computer and software engineering. He currently works for Charles Schwab. He has designed and developed applications, solutions for Cisco, State Street Bank, Echomail and TJX, Tumbleweed, INTEL, Raytheon, Maxtor MMC,Mimosa Systems and Charles Schwab.
Comments
|