1
我想使用Nodejs子进程编译C程序。将运行时参数传递给Nodejs子进程
Ç.out文件执行功能:
var exec= require('child_process').exec;
exec("test.exe",function(err,stdout,stdin){
//call back handling code here
});
C程序:
#include <stdio.h>
int main()
{
char msg[8];
scanf("Please endter %s",&msg)
printf("Hello world %s\n", msg);
return 0;
}
如何运行scanf的输入参数传递给子进程?
你尝试通过它像'EXEC( “test.exe的消息”,函数(){})'。 – Mritunjay
这适用于如果我的主要方法专家CLI的任何参数,但这不适用于scanf输入(@运行时)。 – venkat7668