I wonder how I am able to access the private data of an object which is passed by reference or value? this code works. Why? i need some explanations.
class test_t {
int data;
public:
test_t(int val = 1): data(val){}
test_t& operator=(const test_t &);
};
test_t& test_t::operator=(const test_t & o){
this->data = o.data;
return *this;
}