Original Post
alright let's say i have the following code:
class A {
private:
B* test;
public:
void testPass (B* aParam) {
test = aParam;
}
void testFunc() {
test->DoSomething();
}
}
class B {
public:
int testInt;
void DoSomething() {}
}
main() {
B* myB = new B();
A* myA = new A();
myA->testPass(B);
} how come i get error about illegal access to test, when i use testFunc() in class A? i've run debug and the watcher says: "CXX0030: Error: expression cannot be evaluated" (i'm using vc++.net) what am i doing wrong? (btw, the code above was rewritten from notepad, it's derived from another project code and rewritten for simplicity/discussion/example).