c++调系统命令-system方法
·
#include <iostream>
using namespace std;
int main()
{
cout << "-----pwd-----\n";
system("pwd");
cout << "------ls------\n";
system("ls");
cout << "------ls -lh---\n";
system("ls -lh");
}
-----pwd-----
/home
------ls------
0001#_0.jpg
------ls -lh---
total 2.3K
-rw-r--r-- 1 root root 2.3K 0001#_0.jpg
更多推荐
所有评论(0)