0

如何在另一个下执行 ac 程序。假设你有一个 c 代码(程序),并且你想调用另一个。因为您想向它发送输入,然后通过比较另一个预期返回数据来对其返回数据进行评分。

尝试.c

int main(void) {
    for (i = 0; i < MAX; ++i) {
        /* call another program ( namely, try2.c ) to give it a single input,
        then measure its returning data /*
    }
    return 0;
}

try2.c 驻留在另一个文件中。

编译器是gcc,系统linux下

4

1 回答 1

3

systempopen或平台相关的功能,如forkexec

于 2010-11-26T11:29:00.230 回答