Tutorial - C / C++ - Operator |
|
| Author | Ian - Tutorial Posts = 62 |
| An operator syntax is part of the standard C/C++ syntax that allows you to use the +/-/* etc aspects of the objects that are assoicated with them, for example, for two values of an integer you can add these two values together with value1 + value2, the adding part is calculated within the operator and the value is returned. To code a operator you just need to use the <return type> operator <insert type of operator>(<passed parameter(s)>) function. Within the code below there are 3 types of operators for the operate test class, to add another integer to the internal value, to increament the internal value and also to logically add the internal value with another integer value. The code ---
--- I have included Microsoft Visual Studio 2005 downloadable edition (here) and also Linux code for this tutorial as a download. |
|
| Copyright@CodingFriends, 2005-2006. All Rights Reserved. | |
| Home | Forums | Tutorials | Users | |
