An Example, What my book says....
#include <iostream.h>
class number
{
public:
int n;
number() {n = 1;}
number operator+ (number);
};
number number::operator+ (number N)
{
cout << "\noperator+() function is working ";
number T;
T.n = N + N.n;
return T;
}
void main()
{
number x,y,z;
Z = X.operator+(Y) //Explicit
cout << Z.n; //2
Z = X + Y; //Implicit
cout << Z.n; //2
Z = Z + X + Y; //Chain of calls
cout << Z.n; //4
}
Sorry for the post, but...
Quote:
Originally posted by kedaman
I'm a newbie here, when it comes to C++
Join the party kedaman.
For C++, we have to look to parksie, vlatko, and a few others :rolleyes:.
I wish C++ coding was as easy as VB.
I'm still learning..still reading the tutorials at http:///www.cprogramming.com :o.