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

前端 未结 13 2421
执笔经年
执笔经年 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:32

    throw back to main which should return EXIT_FAILURE,

    or std::terminate() if corrupted.

    (from Martin York's comment)

提交回复
热议问题