Tuesday, July 9, 2013

About pointers and private membership

Newsgroup: comp.lang.c++

Subject: About pointers and private membership

From: joshipura@...

Date: Mon, 8 Jul 2013 10:34:42 -0700 (PDT)



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?







via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?37992-About-pointers-and-private-membership&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment