Pause screen at program completion in C

前端 未结 7 537
名媛妹妹
名媛妹妹 2020-12-17 06:00

I want to be able to do something along the lines of Press any key to exit at program completion, but have no been able to figure out how to.

When I run

7条回答
  •  一个人的身影
    2020-12-17 06:48

    It's an old question but thought I'd add a technique I use when testing programs on a Windows box.

    Compile program into an exe. And then create a batch script to "wrap" the program along the lines of:

    @echo off
    foo.exe
    pause
    exit
    

    which will execute your program as it should be, without any dirty hacks, while allowing you to pause the window and see the output.

提交回复
热议问题