I have a simple program :
class Element
{
public:
Element(void) { m_iVal = 56789;}
~Element(void) {};
private :
int m_iVal;
};
The variable m_iVal
is private, which poses restrictions from a conceptual point of view (inheritance, ...).
However, although private, access to it content is still possible.
Is there a way to prohibit physical access to a varibal (or a heap area) so that any access to this private area will cause a memory access violation.