Ok, I just need a little help. I remember trying to make a list for another Class a few months back for a game I was making for a school assignment, and the list didn't want to initialize. I can't test this yet, as my program isn't done yet, but I just wanted to see if my code so far was correct.
The first part(cut down for clarity):
The second part:Code:private: int maxhp; int fightermaxhplist[50] = { 35, 63, 91, 120, 149, 178, 207, 237, 267, 297, 327, 333, 364, 395, 401, 433, 465, 472, 504, 537, 545, 578, 611, 620, 629, 663, 672, 682, 717, 727, 737, 773, 784, 795, 831, 843, 855, 892, 904, 917, 955, 968, 981, 1020, 1034, 1048, 1087, 1102, 1117, 1157};
Will that work, or will I have to initialize the list some other way? I'd like to keep the list in the class if that's possible, though I could work it into the main program if I had to.Code:int charstats::calculatemaxhp() { if((charclass==1) || (charclass ==7)) { maxhp = fightermaxhplist[level-1]; }