Sounds like you should just set a breakpoint and run the program with a debugger.Quote:
Originally Posted by monarch_dodra
Printable View
Sounds like you should just set a breakpoint and run the program with a debugger.Quote:
Originally Posted by monarch_dodra
Interesting. :) The solution developed by the OP in this thread looks really comprehensive. And it's quite complicated, as comprehensive solutions frequently are. It might actually work (didn't test it though) and it might actually be portable if placed inside a namespace.
You most probably mean http://www.codeguru.com/cpp/misc/mis...cle.php/c15893. The solution proposed there is stunningly simple. :cool: It uses _getch(), defined in conio.h, which I already mentioned as a possibility above. What is mentioned there, and what I didn't know so far, is that there might be an equivalent function named getch() under *nix. So, a portable pause function utilizing this concept might be constructed using #ifdef.
As these low-lovel console I/O functions are independant from iostreams, this solution works with both test scenarios presented by monarch_dodra in post #7. (Yes I did test this.) :cool:
The approach of registering the pause function as an exit handler using atexit() in this article even looked promising to solve the problem of not being able to observe destruction of global objects before the pause, but my hopes in that direction unfortunately got destroyed by MSDN.
BTW, the author's logo at the article suggests that he is the guy who frequents the forums here as a moderator under the name Marc G. He likely will get a rating from me as soon as I come across one of his posts next time... :)
EDIT: Corrected Marc G's user name and added link to his profile page. The guy without the space in the user name is a fresh junior member with zero posts...