Home arrow C# arrow C++ Classes Vs. C# Classes
C#

C++ Classes Vs. C# Classes


With its implementation of C#, Microsoft have given way to some of C++'s nitty-gritty object-orientated features such as templates, and have also changed the way we create classes. In this article, Jordan compares and contrasts classes in both C++ and C#. He focuses on demonstrating how Microsoft has changed certain aspects of creating and using classes in C# including reference types, virtual functions and polymorphism.

Author Info:
By: Jordan Leverington
Rating: 4 stars4 stars4 stars4 stars4 stars / 34
January 22, 2002
TABLE OF CONTENTS:
  1. · C++ Classes Vs. C# Classes
  2. · How have classes changed?
  3. · Limiting access to classes with class modifiers
  4. · Virtual functions in C and C#
  5. · Polymorphism in C and C#
  6. · Conclusion

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
C++ Classes Vs. C# Classes
(Page 1 of 6 )

Object-orientated programming has taken us a long way in terms of application design and development in the last twenty or so years. A program is no longer thought of as a series of functions, which are executed in sequence (like in the procedural programming paradigm), but rather as a set of objects where each object exposes certain properties and methods allowing it to interact with other objects.

The "C" series of languages is a great example of how Object-orientated design disciplines have evolved over time. C++ provides developers with an excellent implementation of object-orientated programming, allowing them to explicitly create constructors, copy constructors, override operators, use templates, etc.

The main problem with a complex language like C++ is that it takes several months to truly master its object-orientated design nature, with each new programmer having to come to grips with templates, function overloading and of course sensible class creation and usage.

With its implementation of C# (pronounced C-Sharp), Microsoft have given way to some of C++’s nitty-gritty object-orientated features such as templates, and have also changed the way we create classes. In this article, I'm going to compare and contrast classes in both C++ and C#. I will also focus on demonstrating how Microsoft has changed certain aspects of creating and using classes in C#.

This article was written for fluent C++ programmers looking for some common ground when trying to learn C# and its object-orientated capabilities from scratch.


blog comments powered by Disqus
C# ARTICLES

- Introduction to Objects and Classes in C#, P...
- Visual C#.NET, Part 1: Introduction to Progr...
- C# - An Introduction
- Hotmail Exposed: Access Hotmail using C#
- Razor Sharp C#
- Introduction to Objects and Classes in C#
- Making Your Code CLS Compliant
- Programming with MySQL and .NET Technologies
- Socket Programming in C# - Part II
- Socket Programming in C# - Part I
- Creational Patterns in C#
- Type Conversions
- Creating Custom Delegates and Events in C#
- Inheritance and Polymorphism
- Understanding Properties in C#

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials