R
ranjit mario noronha
Hi,
I am trying to overload the ->operator as follows :
class foo {
public:
int a;
int operator->() ;
};
int foo:perator->() {
cout<<"Hullo"<<endl;
return 1l;
}
void main() {
foo *f=new foo();
cout<<f->a;
}
However the value of a is printed (0) and the operator function is not
called. Does anybody know what mistake I'm making ?
Thanks,
__
Ranjit
________________________________________________________________________________
Ranjit Noronha
Graduate Research Associate
Dept. of Computer and Information Sciences
The Ohio State University
Phone: (614)477-9900
E-mail: (e-mail address removed)-state.edu
________________________________________________________________________________
I am trying to overload the ->operator as follows :
class foo {
public:
int a;
int operator->() ;
};
int foo:perator->() {
cout<<"Hullo"<<endl;
return 1l;
}
void main() {
foo *f=new foo();
cout<<f->a;
}
However the value of a is printed (0) and the operator function is not
called. Does anybody know what mistake I'm making ?
Thanks,
__
Ranjit
________________________________________________________________________________
Ranjit Noronha
Graduate Research Associate
Dept. of Computer and Information Sciences
The Ohio State University
Phone: (614)477-9900
E-mail: (e-mail address removed)-state.edu
________________________________________________________________________________