Hi,

In the following code I am overloading the member
access operator '->' . But when I actually make a
member function call using '->', the message inside
the overloaded function does not show. The method
call works alright as if the operator was never
overloaded.

PHP Code:
#include <iostream.h>
#include <string>

// ComplexNumber: class definition
class ComplexNumber
{
private:
    
long X;
    
long Y;
    
public:
    
void Assign(long pXlong pY)
    {
        
pX;
        
pY;
    }

    
void Show(void)
    {
        
cout << << "+" << <<"i" << endl;
    }

    
ComplexNumberoperator->(void)
    {
        
cout << "Overloaded -> ..." << endl;
        return 
this;        
    }
};

// main()
int main(int argccharargv[])
{
    
ComplexNumber *pC1 = new ComplexNumber;

    
pC1->Assign(810);
    
pC1->Show();

    
delete pC1;

    return 
0;