Okay this one i cannot figure out, it seems fine to me
This is basically a cheat code to use for testing my rpg game as I build it. It's about 1/4 the way done and i just decided to do this and it will not work. Basically it is comparing what you enter to see if it is megan, if so it should assign the values to your stats and go to the main menu. Well it doesn't do that, if I type in megan, it will not give me those stats. Does anyone know what i did? Thanks.
Code:
char secret[80] = "megan\0";
cout<<"+--------------------+\n";
cout<<"|What is your name? |\n";
cout<<"+--------------------+\n\n";
cout<<"\tPlease enter your name: ";
gets(stat.name);
if(strcmp(stat.name, secret))
{
strcpy(stat.classname, "Humanoid");
stat.classn = 9;
stat.maxhp = 100;
stat.hp = stat.maxhp;
stat.maxmp = 100;
stat.mp = stat.maxmp;
stat.attack = 100;
stat.defense = 100;
menu();
}