class CTest
{
public:
CTest(){m_nNumber = 5;};
~CTest(){};
void SetNumber(int nNew){m_nNumber = nNew;};
protected:
int m_nNumber
}
Is there any way to get access to that protected member variable WITHOUT
adding a public accessor variable such as "int GetNumber(){return
m_nNumber;};"? For reasons I cannot go into, I cannot change the above class
to add this fucntion.
I've tried this sneaky solution:
class CTry : CTest
{
public:
CTry(){};
~CTry(){};
int GetNumber(){return m_nNumber;};
}
But all I ever get is a the "5" set by the constructor. Is it possible
somehow to use a copy constructor for this.
Any replies much appreicated,
Regards
Alain