|
![](/i/fill.gif) |
Warp wrote:
> (That doesn't mean you can't have a pointer pointing to a member of an
> object, in a portable way. However, that requires either for the member
> to be public or for the object to give you the pointer.)
Actually, just thinking about it a bit more, if the class returns a pointer
to a member variable, and you can look in the header and see that pointer is
in an array, then you have a well-defined way of accessing the other private
data in the same array.
Like, if the class returns a FILE* from open(), and you look in the class
declaration and there's something along the lines of
FILE open_files[MAX_OPEN_FILES];
then chances are you can wander up and down that array as you like. :-)
I wouldn't say that particularly breaks encapsulation tho. Just a thought.
--
Darren New, San Diego CA, USA (PST)
The question in today's corporate environment is not
so much "what color is your parachute?" as it is
"what color is your nose?"
Post a reply to this message
|
![](/i/fill.gif) |