Sunday 15 July 2012

c++ - Accessing Class Data from Declared Struct -


OK, so I've tried a few ways to deal with this issue, but I'm unable to fix it .

I have in my header file:

  class MyClass {public: bool test; Straight Mistrate; };   

I also have a constructor and that is all, but this is not important / is not causing errors

What I want to do in CPP is this: MyClass :: MyStruct {test = true; };

With this problem, it is that the structure is unable to reach the test variable. How can I do the variable of the current instance of the struct or allow the structure to reach the variable in some other way?

I think if the Mystreet code is executing then it should be a class. And if so, you either pass an example of this MyClass (like this if calling from MyClass), or pass it to the reference of the member that is required ( Such as this-> test ) ...

No comments:

Post a Comment