In your inner loop (when you are comparing the guess) you are looping from 0 - MAX_GUESSES -- but you only want to loop through the guesses that exist (i.e. you have only filled out guesses from 0 - guess, not 0 - MAX_GUESSES


Also, remember that c++ arrays are zero-based indexes, so you want to loop 0 through (MAX_GUESSES - 1) in your outer loop, or you will run into trouble since guesses[MAX_GUESSES] is not defined. You can fix this simply by using "<" rather than "<=" in your outer loop.