fflush
I have been tediously debugging today…
Use fflush(stdout) after the command of printing debug information. Because the program might have crashed before the print information is sent to the terminal(Yes, it’s possible, and that’s what costs me 2 hours debugging!) And finally it turns out to be an index running over the boundary.