在C++中的作用是暫停。
無返回值時暫停,又返回值時不暫停。
#include <iostream>
#include <stdlib.h>
using namespace std;
void main(){
system("pause");
}
#include <iostream>
#include <stdlib.h>
using namespace std;
int main(){
system("pause");
return 0;
}
注意,在C++中,使用system("Pause")需要添加頭文件stdlib.h。
C++現在強制main返回類型是int。。。注意一下。
就是簡單記錄一下。。。
帶.h的頭文件爲C的頭文件。