Counting in array references starts from 0, not 1 (as others have said).

That means that level 1 will be array[0], level 80 will be array[79], and level 100 will be array[99].

This is called zero-based indexing.

If I may suggest, you may want to calculate your player levels using a math function.

It seems to me that your players may be able to level up an arbitrary number of times, making it

impossible to pre-define the experience requirements for all levels. (You can define a specific

subset of levels, but that's out of the scope of this discussion).

You can use a site like

this to visualize your level curve.

int CalcExpToLevelUp( int level )
{
// y = x^2
// Where y is your xp to level and x is your current level
return level*level;
}
int Level = 0;
int Exp = 0;
int ExpToLevel = 0;
bool Player_Update()
{
...
// Can we level up?
if( Exp >= ExpToLevel )
{
Exp = 0;
++Level;
ExpToLevel = CalcExpToLevel( Level );
}
...
}

This may not necessarily be the best or fastest method, but it is flexible.

Keep in mind this is pseudo-code, and not compiled or tested. It is meant

only as a conceptual reference.

I hope this all makes sense, it's been a long night and I'm pretty tired.

I'm sure if there's something I was fuzzy on someone will correct me.

Best of luck!