討論串[問題] 請問要怎抓呼叫外部程式所得的回傳值
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者lungswu (宅爸)時間16年前 (2009/08/21 12:11), 編輯資訊
0
0
1
內容預覽:
參考一下吧. from http://zbarbar.blogspot.com/2009/08/blog-post_6471.html. @HOST:~/tmp$ cat redir.c. #include <stdio.h>. #include <stdlib.h>. #include <unis
(還有409個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者pshuang (Angus )時間16年前 (2009/08/20 13:56), 編輯資訊
0
0
0
內容預覽:
只會用 system() 的話. system("ls > /tmp/ls.result");. 之後再讀 /tmp/ls.result 這個檔案就好. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 59.104.56.17. 編輯: pshuang 來自: 59.104

推噓0(0推 0噓 1→)留言1則,0人參與, 最新作者lolo33 (none)時間16年前 (2009/08/19 14:52), 編輯資訊
0
0
0
內容預覽:
請問一下 我想要做到說 利用呼叫system("ls") 執行外部程式. 但是我想要將結果存在 buffer 中, 而不是直接輸出到console. 請問有辦法可以做到嗎?. 感謝. --. 發信站: 批踢踢實業坊(ptt.cc). ◆ From: 116.59.6.155.
首頁
上一頁
1
下一頁
尾頁