J
joshipura
I have a basic question.
I want to communicate a value v [2D array of characters] between two objects o1 and o2 of classes c1 and c2 respectively. Something like this:
c1's code calls
o2::method; //should return value v
My question is, if this value is defined as a private member of o2/c2, should not this address be invalid/illegal in the scope of o1?
Then, if I define the array as a member of o1/c1 and pass it by reference, should it not be invalid/illegal in the scope of o2?
If private members don't have any meaning outside the object, how do pointers ever pass?
I want to communicate a value v [2D array of characters] between two objects o1 and o2 of classes c1 and c2 respectively. Something like this:
c1's code calls
o2::method; //should return value v
My question is, if this value is defined as a private member of o2/c2, should not this address be invalid/illegal in the scope of o1?
Then, if I define the array as a member of o1/c1 and pass it by reference, should it not be invalid/illegal in the scope of o2?
If private members don't have any meaning outside the object, how do pointers ever pass?