Library tutorials & articles
A comparison of C/C++ and C#
- Introduction
- What really is C#?
- Comparison with C/C++
- Conclusion
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.
Related articles
Related discussion
-
C# video Editing/rendering
by pkuchaliya (0 replies)
-
How to Fill DataSet with more records (around 1 lakh) in a faster way
by Jayaram P (0 replies)
-
Can't print on the network with MSADESS ??
by anatha1 (2 replies)
-
Very Urgent regarding deleting the images from a folder
by Nanosteps (6 replies)
-
DataGridViewComboBoxColumn not showing values
by sachinkalse (0 replies)
Related podcasts
-
Object-Oriented Programming in Ruby
In this episode, I talk with Scott Bellware about object-oriented programming in Ruby, and Ruby's object model. This is taken from a private conversation, and the audio quality suffers at times. Much thanks to Scott for allowing this to be released.This episode of the Alt.NET Podcast is bro...
pleas help me
i need source code for dial up (C#)
This thread is for discussions of A comparison of C/C++ and C#.