What does 'error: invalid use of member function' mean in c++?

Example:

class MyClass {
    void myFunction() {}
};

int main() {
    MyClass obj;
    if (obj.myFunction) { /* ... */ }
}

You're using a member function without calling it (missing parentheses).

Solution:

Call the function using parentheses.


MyClass obj;
if (obj.myFunction()) { /* ... */ }

Beginner's Guide to C++