And does it show that it changed at startup?
Your graph array must be filled somewhere with values, else it's a useles addition to your code (
). It also must have a size that we can't see. You're using a variable Max that we can't see. What else is there that we don't know about?
So I suggest that you post your full code so we don't have to guess.
Assume that you have an array with 5 elements
int anArray[5];
and you somewhere do the below, you will have a problem.
anArray[5] = someValue;