How does the compiler control protection of variables in memory? Is there a tag bit associated with private variables inside the memory? How does it work?
It's the compiler's job to see that some members are private and disallow you from using them. They aren't any much different from other members after compilation.
There is however an important aspect, in that data members aren't required to be laid out in memory in the order in which they appear in the class definition, but they are required to for variables with the same access level.