I have question with this same title here but now as I'll present in code below this seems to behave in the opposite way to the way explained to me in my first question with the same title. Ok code:
class LINT_rep
{
private:
char* my_data_; //stores separately every single digit from a number
public:
class Iterator:public iterator<bidirectional_operator_tag,char>
{
private:
char* myData_
public:
Iterator(const LINT_rep&);
};
};
#include "StdAfx.h"
#include "LINT_rep.h"
LINT_rep::Iterator::Iterator(const LINT_rep& owner):myData_(nullptr)
{
myData_ = owner.my_data_; /*
HERE I'M ACCESSING my_data WHICH IS PRIVATE AND THIS
CODE COMPILES ON VS2010 ULTIMATE BUT IT SHOULDN'T
BECAUSE my_data IS PRIVATE AND OTHER CLASS SHOULDN'T
HAVE ACCESS TO IT'S PRIVATE MEMB. AS EXPLAINED TO ME IN
QUESTION TO WHICH I;VE PROVIDED LINK. */
}
Question in the code. Thanks.