1
我目前正在关注由youbube上的newboston创建的教程。我并不是一字不差,但足够接近。system()函数不工作C++
我简单的程序:
#include <iostream>
#include <string.h> /* memset */
#include <unistd.h> /* close */
#include <stdio.h>
#include <stdlib.h>
#include <cstdlib>
int main(){
using namespace std;
cout << "Those who wander too far off the path of reality. Will be plunged into total Madness." << endl;
cout << " - BinKill-Ethical" << endl;
system("cls");
return 0;
}
这是我在C首先++编程,我已经创建。我几乎不知道,但我无法让system()函数工作。
输出:
所有除#include <iostream>
来自其他计算器职位的建议,试图得到这个工作。没有工作。如果有问题,我正在使用G ++进行编译。
就C++而言,“系统”不保证任何结果。你没有'cls'命令(Windows默认是这样的,这就是本教程的用途)。 – chris
使用'system(“cmd/c cls”);' –
@CaptainObvlious,不是Windows,通过''判断。 –
chris