问题描述
as" spawnl"通过C代码执行exe。同样,我们怎么能通过另一个C程序(在Windows平台上)编译一个C程序?
unix平台中的命令也会这样做...
spawnl不是标准的C函数,因此是OT,运行编译器的
的详细信息也是OT,但类似于 ; system(" cl
myprog.c");"假设
环境设置正确,可能会在某些平台上发挥作用。
unix平台中的命令也会这样做...
您可以尝试:
system(" cc file.c");
当然你也可以为cc提供其他选项。
As "spawnl" executes an exe through C code., similarly how can we
compile a C program through another C program (on Windows platform) ?
Command in unix platform will do too...
spawnl is not a standard C function and so is OT, and the details of
running compilers is also OT, but something like "system("cl
myprog.c");" might do the trick on some platforms, assuming the
environment is set up correctly.
Command in unix platform will do too...
You might try:
system("cc file.c");
Of course you can supply other options to cc too.
这篇关于通过另一个C程序编译C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!