【发布时间】:2018-03-18 09:00:41
【问题描述】:
我来调用 then 函数一切顺利
int status = system("./my_exe_file input output");
但是当我想在函数中调用它时,我在处理文件时遇到了一点问题:
void call(std::string f){
FILE *in = fopen (in, "r");
int status = system("./my_exe_file f output");
}
谁能告诉我该怎么做?
【问题讨论】:
-
你需要将你的字符串连接在一起......
-
怎么办?有什么问题?有什么问题?
-
@EJP:OP 想要在传递给
system的字符串中插入f。 -
FILE *in = fopen (in, "r");应该做什么?这种方式毫无意义。正确的in不应该是f吗? -
@MatsPetersson 我在这里只能看到“我在处理文件时遇到了一点问题”。这不是问题描述。代码甚至无法编译。