very basic C++ program closes after user input for no particular reason?

前端 未结 7 1184

I just started learning C++ and I wrote this sample program from the text and when I compile and run it, it just closes after the user inputs any number and presses enter.

7条回答
  •  孤城傲影
    2021-01-18 04:48

    Either put another read from cin to wait for the user, or open the Command Prompt yourself and run it there.

提交回复
热议问题