473,549 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the difference between C Sharp and C/C++?

55 New Member
What is the difference between C Sharp and C/C++?
Jun 2 '10 #1
2 3924
nukefusion
221 Recognized Expert New Member
There are a number of differences between C# and C++. I'll mention just a few of the key differences here.

Firstly, C++ programs compile down to machine code, which execute directly on the machine, whereas C# programs compile down to something called IL (Intermediate Language). IL is then executed by something called the CLR (Common Language Runtime). This fact brings us onto the second and probably biggest difference, which is memory management.

In C++ memory management is manual. References must be counted and disposed of manually. Failure to do so can lead to the age-old favourite: memory leaks. In C#, the CLR provides garbage-collection for you, so there's no need to worry about reference counting, pointers, etc, etc (although if you really want to mess with pointers you can using the unsafe keyword)

Thirdly, C# supports only single inheritance, unlike C++ where multiple inheritance is allowed. (Of course, C# interfaces provide alternative functionality).

Fourth, C# provides support for metadata, that is the attachment of attributes to classes, properties and methods.

These are just some of the main differences, there are others and you can probably find some very good articles on MSDN that give you more detail.
Jun 2 '10 #2
neogazz
55 New Member
Many thanks, this is excellent!
Jun 3 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
445
by: Vi | last post by:
Some of you might be interested in this open source AutoUpdater for ..NET "Sharp AutoUpdater provides an auto-update feature for .NET applications. Using XML configuration files, Sharp AutoUpdater component detects if there is a new version of the software, downloads, unzips, and installs the new files." Link:...
0
1515
by: application | last post by:
is it possible to create a simple com dll in c-sharp? i need to use a c-sharp com from an asp page( not aspx) and i read in google about regasm and csc and some other strage words but never find a full example of how to do it. Thanks
2
1985
by: Ben | last post by:
Hi all I am new to C Sharp. Any suggestion for some good C Sharp sites? Thanks for sharing. Ben
0
1643
by: Eugene | last post by:
9rays.net Report Sharp-Shooter 1.3 has been published! Report Sharp-Shooter is the most flexible .NET report engine available on the market. It's a suite of 100% managed .NET components that allow you to create both bound and unbound reports with unlimited number of master-detail relations. You can build highly complex reports by using...
4
2493
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got hard time to understand vb syntax. I don't know if anyone in here can point out which is the equivalent object used in c sharp. Translate these...
9
2339
by: Dragon | last post by:
Hi, I have 'some' experience in VB. I would like to learn C-Sharp and would like to know if the following book is any good or not. Thank you. Microsoft Visual C# .NET Step by Step - Version 2003 by John Sharp and Jon Jagger ISBN:0735619093
2
3886
by: HishHish | last post by:
I have a Java code that I want to convert it to C-sharp in order to put it in my ASP.NET web application. I used the JLCA (Java Language Conversion Assistant) for conversion, but it gave me many errors indicating that there are not matches in .NET for those Java classes!! The Java code is: ...
23
2280
by: arthur.mcginty | last post by:
Man I've grown tired with C#/.NET the last three days I spent trying to put a NULL value in a database. C# initializes all uninitialized properties to 0 (for numeric types) and didn't have until C# 2 any concept of NULLs. I keep wondering how you guys built all these .NET apps on the top of a database. And guess what? If you fail to...
5
1687
by: Alberto | last post by:
What sharp (from c sharp) stand for or where does it comes from? thank you
20
2591
by: windandwaves | last post by:
Hi Folk I am a PHP programmer, but I like to learn c-sharp as it seems to be in hot demand around here. My questions are: - how does c-sharp relate to PHP - do you like c-sharp and its cousins - are there better things to do then c-sharp? Thanks a million
0
7451
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5372
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5089
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.