- 本文主要实现c++调用shell & shell调用python
- c++/cpp2shell.cpp
- 向shell脚本传入参数,并获得返回值
#include <stdlib.h>
#include <iostream>
using namespace std;
string exec(const char* cmd) {
FILE* pipe = popen(cmd, "r");
if (!pipe) return "ERROR";
char buffer[128];
std::string result