如何在另一个程序下执行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系统下