开发者

how can I execute c program under another one

How can I execute a c program under another one. Assume you have one c code (program), and you want to call another one. Because you want to send input to it then score its return data with comparing another expected return data.

try.c

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

try2.c reside in another FILE.

Compiler is gcc, and under system linux


system, popen or platform depended features like fork and exec

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜