News for hackers. Stuff that matters.
Re:What's the difference between the com and exe extensions?... by to3m on Saturday May 27, 2017 @04:55PM (#14431933)
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.

There are no comments on this comment yet.