constructor problem

what is wrong with line 11
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
#include <iostream>
using namespace std;

class warrior
{
public:
    int age;
    void health();
    void speed();
    void attack();
    warrior::warrior();
};

warrior::warrior()
{

}

void warrior::health()
{

}
void warrior::speed()
{

}
void warrior::attack()
{

}


int main()
{
    warrior war;

}
Last edited on
you shouldn't use the scope operator when you are already inside that scope.

Since line 11 is already in the warrior class, you don't need to put warrior:: before the constructor like that.
thanks
thats weird cuz the tutorial showed that you have to be able to even use the the constructor
Topic archived. No new replies allowed.