How do I make a C++ console program exit?

前端 未结 13 2463
执笔经年
执笔经年 2020-12-03 16:43

Is there a line of code that will terminate the program?

Something like python\'s sys.exit()?

13条回答
  •  感动是毒
    2020-12-03 17:16

    simple enough..

    exit ( 0 ); }//end of function

    Make sure there is a space on both sides of the 0. Without spaces, the program will not stop.

提交回复
热议问题