Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2006, 12:31 PM
Registered User
 
Join Date: Jul 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default c# and c++

 hi what are the main differences between c# and c++

 
Old July 30th, 2006, 03:39 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Please take a look here and see if that helps: http://www.catb.org/~esr/faqs/smart-questions.html

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old August 4th, 2006, 12:20 AM
Registered User
 
Join Date: Jan 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear sreenu,
The information i'm giving as per my knowledge is right.
here is your question result.

Difference between C# and C++

1. C# does not support multiple inheritance.
2. C# does not support pointer types for manipulating. However, they are used in ‘UNSAFE CODE’.
3. We can only create objects using new keyword.
4. Arrays are classes in C# and therefore they have built in functionality for operations like searching, sorting and reversing.
5. Arrays are referenced types rather than value types as they are in C++ and therefore stored in the heap.
6. C # does not allow silent fall through in switch statements It requires explicit jump statements at the end of each case statement.
7. In C#, switch can also be used on string values.
8. C# does not support default arguments.
9. In exception handling, unlike in C++ ,we cannot throw ant type in c#. The thrown value has to be reference to a derived class or System.Exception object.
10. We can’t access static members via an object , as we can in C++;
11. C# defines null as a keyword and considers it as an intrinsic value.
12. General catch statement catch(…) in C++ is replaced by simple catch in C#.

Features of C++ which are dropped
1. Macros
2. Multiple Inheritance
3. Templates
4. Pointers
5. Global variables
6. Default arguments
7. Constants number functions

Enhancement to C#
1. Automatic Garbage Collection
2. Versioning support
3. Strict type safety
4. Delegates and events
5. Boxing and unboxing
6. Web services



I hope u like it.

with regards
Dev
 
Old August 4th, 2006, 12:28 AM
Registered User
 
Join Date: Jan 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Imar,
i like your given link.I got the point which you suggest.Thanks. I hope other guys whoever read your reply got the point.

with regards
Dev









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.