这是我的C++代码:
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
cout << "Hello, world!" << endl;
system("pause");
system("cls");
return 0;
}
字符串
我在cygwin编译它,我有这个错误:sh:line 1:pause:command not found sh:line 1:cls:command not found.我已经安装了ncurses,但它仍然不工作,有人能帮助吗?
1条答案
按热度按时间wlsrxk511#
如果你真的想运行这个程序,你可以使用
system("cmd.exe /c pause")
或system("cmd.exe /c cls")
。然而,正如其他人已经指出的那样,它可能是不完整的或存在安全风险。