Hi
Can you explain the below mentioned code. As far as I know we need to
overload = operator in order to equate object of a class and below code
should give error. But it is running perfectly on gcc compiler. Please
correct  me if I am wrong at some point.

#include<iostream>
using namespace std;

class emp
{
      public:
             char *n;
             int age;
};
int main ()
{
    emp e={"xyz",21};
    emp e2;
    e2=e;
    printf("%d",e2.age);
    system("pause");
}


-- 

Regards
Ravi Maggon

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to