This is what I use, it pauses right before exiting, it's pretty much the same as getchar(), only difference that pressing any key works to exit, where if you use getchar() you have to hit return (enter) to exit
system("PAUSE");
return EXIT_SUCCESS;
Cheers,
Waldis