当我尝试使用exec时:
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
int main()
{
exec("echo `Hello World`");
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
code.c:11: error: implicit declaration of function ‘exec’
make: *** [code.o] Error 1
Run Code Online (Sandbox Code Playgroud)
我必须使用std = c99,我不能添加任何其他编译器标志.我怎样才能使用exec(或同一个电话)?
我猜解决方案对于杀人来说是一样的,不是吗?