Try adding exit(0);
after your pause statement. This will tell your program to exit completely. The 0 is simply a return value. You can return whatever you want, but 0 is standard for "no errors" or something like that.
EDIT: On second thought, simply add return 0;
at the end. You may not even need the exit(0) statement (it depends on how you're running your program).
SECOND EDIT: The exit() statement simply force-closes your application. There is still an underlying issue. Give me a bit and I will try to track it down for you.
Hope this helps!