C++ 调用系统命令并显示

180it 2023-01-20 PM 652℃ 0条
#include <cstdio>
#include <fstream>
#include <cstring>
#include <string>
#include <windows.h>

using namespace std;

// 执行命令行命令
inline void CMD(string str)
{
    system(str.c_str());
}

int main()
{
    CMD("ping www.baidu.com");
    return 0;
}
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

C++ 调用系统命令并显示