3 ms·
Best solution I've found: static void PressEnter(void) { if(IsDebuggerPresent()) { fprintf(stderr,"press enter\n"); getchar
by to3m 9y ago
Best solution I've found:
static void PressEnter(void) {
if(IsDebuggerPresent()) {
fprintf(stderr,"press enter\n");
getchar();
}
}
Then from somewhere right near the top of main or whatever:
atexit(&PressEnter);
You can throw in some isatty calls, or #ifdef _CONSOLE, or if(GetConsoleWindow()), etc., but the above pretty much always does the right thing.