我使用的是M1芯片的MacBook,clang++编译器
示例:
#include<iostream>
using namespace std;
int main()
{
cout << "11111" << endl;
cout << "11111" << endl;
cout << "11111" << endl;
cout << "11111" << endl;
cout << "11111" << endl;
system("clear");
cout << "11111" << endl;
return 0;
}
结果:
11111
11111
11111
11111
11111
TERM environment variable not set.
11111
如果有其他方法也可以实现system的作用,望请告知。