1void LevelUp()
2{
3 static const int required_experience[] =
4 {
5 0, 45, 95, 145, 210, 285, 380, 495, 610, 745, 99999999
6 };
7 //so whenever myexp reaches on of these integers, mylvl will go up by 1
8
9 while(myexp >= required_experience[mylvl])
10 ++mylvl;
11}