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

前端 未结 7 1259

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 05:04

    After the user inputs a number, which is saved to numberOfLanguages, it reaches return 0 which returns from the main function and thus the program ends.

提交回复
热议问题