|
| About | Home | Disclaimer | Privacy | Contact | |
|||
Visual C++ .Net Programming Tutorials: C++ .NET Operator & Function Overloading |
|||
Read me first buddies |
|||
|
|
C++ You’ve already seen how to construct classes and structs, provide member functions in your types, and use these functions in programs. In this module, you’re going to find out about a special category of member functions called overloaded functions (and overloaded operators), which allow you to add extra functionality so that your types can be used more naturally and intuitively. If you’ve met operator overloading in C++ before, you need to be aware |
|
HomeOperator Overloading 1Operator Overloading 2Operator Overloading 3Operator Overloading 4Operator Overloading 5Operator Overloading 6Operator Overloading 7
----------------Tenouk C and C++ Programming Tutorial |
|
that overloading is handled completely differently in managed C++ than in traditional C++ though the syntax-wise may be similar. In fact, managed C++ types aren’t allowed to implement traditional C++ overloaded operators, so you’ll need to pay close attention to this module to find out how operator overloading is now done. You already met the operators provided by the C++ language before. The problem is that those operators work only with the built-in types, and you’re starting to use classes and structs to define your own data types. This means that if you want to do an addition operation or a comparison operation on types that you’ve created, you can’t use the + and == operators because the compiler doesn’t know how to apply them to your types. Operator overloading is a C++ feature that lets you define operators to work with your types, that is a user defined type which can often lead to a more natural style of programming. Generally, overloaded operators are needed by classes that wrap simple values. |
|||
|
| About | Home | Disclaimer | Privacy | Contact | |
|||
|
Best viewed using IE 6.0/FireFox 1.5.0 and above Webmaster contact: [contact[@]visualcplusdotnet.com] Copyright 2007 © Visualcplusdotnet. All rights reserved. |
|||
| Excellent hosting services provided by MochaHost - The Online Central | |||