0
Help me, please
segmentation fault (core dump)
3 Réponses
+ 1
check the return type on your public members
Edit: also check your private members and check the order you declare them
0
There is it, I can't find the mistake
#include <iostream>
using namespace std;
class rcHuman
{
public:
string getMainAtt()
{
cout<<att[0]<<endl;
}
string getSecAtt()
{
cout<<att[1]<<endl;
}
int getAllAttValue()
{
for(int x=0; x<4; x++)
{
cout<<att[x]<<"=";
cout<<value[x]<<endl;
}
return 0;
}
private:
string att[4] { "Strength", "Dexterity", "Constitution", "Willpower" };
int value[4] { rand(), rand(), rand(), rand() };
};
int main()
{
rcHuman victim;
victim.getMainAtt();
victim.getSecAtt();
victim.getAllAttValue();
return 0;
}
0
i think little bit confusion in private......