开发者

Get the result of a Shell Commands within C

开发者 https://www.devze.com 2022-12-13 01:54 出处:网络
I\'m trying to find a function to call a system command (shell command) and get back its result in a C program.

I'm trying to find a function to call a system command (shell command) and get back its result in a C program. I开发者_JAVA百科 only found functions like system but these don't return the result of the command.

I just know it in perl : my $results = ``my shell command` ;

Thanks!


You're looking for popen(), at least on POSIX (Linux etc) systems. In Windows, a different solution is likely needed.

0

精彩评论

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