开发者

C++ get PID using system

I am running a file using system, but I don't know how开发者_开发问答 to get the PID of that process. Does anybody know how to?


You might want to use fork and exec instead of system. The child process pid will be returned from fork to the parent process.

Edit in case it wasn't obvious, my answer was before the author tagged his post with windows. My answer is specific to Linux.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜