Quote:
Originally Posted by akshay_pirate well buddy,-> operator is used when you want to use data members or member functions of a class using that class's object's pointer.
ex:
class C{
public:
int x;
void get(int a){
x=a;
}
};
void main(){
C c;
C *c1;
c1=c;
c1->a(3);
cout<<c1->x;
} |
what's the difference with this then:
Code:
void main() {
C c;
c.a(3);
}