C++ is giving me all kinds of headaches. How do i access a private member of another class inside a different class? My example code below, I'm trying to access its members but I keep getting all kinds of errors about it is a private member of another class.
class Ex1 {
private:
int test1;
};
class Ex2 {
public:
Ex2();
void access2Ex();
private:
Ex1 *pointer_to_Ex1;
};
I want to access Ex1 from Ex2 and do nAsty stuff to it in Ex2 and by nasty I just want to be able to touch it, caress it, or make it at least acknowledge that Ex2 exists. Anyone can help me out, I'd appreciate it.