looks like eltec really needs to learn some basics of OOP and c++.
Variables etc that are members of a class need an *instance* to be available. To set/get members, or use member functions, an *instance* must be available.
class MyClass
{
public:
int x;
};
int main()
{
MyClass myclass; // make an instance!
myclass.x = 5; // set the variable
int x = myclass.x; // get the variable
MyClass::x; // wrong!
myclass->x; // wrong! myclass is not a pointer.
MyClass.x // wrong! MyClass is not an instance
}
class MyClass
{
public:
int x;
};
int main()
{
MyClass myclass; // make an instance!
myclass.x = 5; // set the variable
int x = myclass.x; // get the variable
MyClass::x; // wrong!
myclass->x; // wrong! myclass is not a pointer.
MyClass.x // wrong! MyClass is not an instance
}
To copy to clipboard, switch view to plain text mode
OP, please learn a little (well, ok more than a little) about c++ - this will also involve learning some about oop.
Bookmarks