problem and needs a hand

Hey guys I'm just begining C++ and i am having a bit of trouble with class and if statements.

So the code is basically asking you to enter your number to access the account (10) and if you are wrong you will be prompted again to retry but i get an error on line 28 saying "error: statement cannot resolve address of overloaded function" any help or advice would greatly be appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 #include <iostream>

using namespace std;

int  a;

class LoginHome{
public:
    void failLog(){
        cout << "Incorrect Password! Try again \n";
        cin >> a;
    }
    void winLog(){
     cout << "Correct!! Welcome Nick \n";
    }

};


int main()
{
   cout << "Who are you? \n";

   cin >> a;

   if(a==10){
    LoginHome loginObject;
    loginObject.winLog;
   }

   if (a!=10){
    LoginHome loginObject;
    loginObject.failLog();

    return 0;
   }
}
Last edited on
 
  loginObject.winLog;


You are missing the () to call a function with.
I notice you don't have () after winLog.
Topic archived. No new replies allowed.