monarch_dodra, I think you're right in that any stream-based pause function would have more or less the same specific weaknesses. To get around this, I think of using the conio functions, but I'm afraid they're most probably specific to Windows or even MS VC++.

For overcoming the necessity of calling pause() at the end of main() I think of making some kind of reverse-RAII pause class that does the pause on destruction and instantiate it as a global object. But even then there's no way to control whether it would actually get destroyed as the last one of the global objects. I better don't start to think about C++ runtime manipulations... But couldn't it be a surprisingly simple solution to just wrap the toy program into another one that does nothing more than exec...() the toy and then pause? The only problem then would be to have the IDE use that.

In the end, simply using a separate console window might be the best solution. (Don't remember right now who suggested that.)

And BTW, at least under Win XP a malicious pause program wouldn't have a chance: The pause command there is hardcoded inside the shell and always has priority over any program with the same name.