c++ win32控制台应用程序 完成操作后 自己关掉是怎么回事?

2025-05-01 18:09:37
推荐回答(3个)
回答1:

1. 在 return 0 前加一句 system("pause");
2. 在 return 0 前加一句 getch();
3. 在 return 0 上加个断点

控制台运行结束后,会自动关闭回到Windows环境,以上三种任选一种,可以在最后return 0时停下来。

回答2:

用C::B Debug不会自己关掉……

回答3:

运行按ctrl+F5