It doesn't appear that you return out of the main function at the end of the program. Perhaps a simple
before your last closing brace may help here.Code:return 0;
Okay, I just re-read your post and you said that it crashes *before* you get your answer. So the ending return statement won't help here - it is a good idea to put it in though.