arg=buf[1];if(fn==1){res=foo(arg);}elseif(fn==2){res=bar(arg);}buf[0]=res;write_cmd(buf,1);}} 注意C程序在while-loop