[問題] 沒辦法使用pipe

看板C_and_CPP作者 (*〞︶〝*)時間11年前 (2014/10/18 02:39), 編輯推噓1(103)
留言4則, 3人參與, 最新討論串1/1
開發平台(Platform): (Ex: VC++, GCC, Linux, ...) Windows Eclipse IDE for C/C++ Developers, Version: Kepler Service Release 1 Toolchain: MinGW GCC 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) Boost 問題(Question): 最近在複習以前寫的pipe() 只是以前是用C然後在Linux編譯 現在用C++在Windows編譯 然後發現沒辦法使用 int test[2]; pipe(test); 這種方式建立pipe 有稍微估狗到 C++為了一些考量 標準函示庫把unistd拿掉 必須 include <unistd.h> 只是用起來依然報錯 求大神指教 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): error: 'pipe' was not declared in this scope 程式碼(Code):(請善用置底文網頁, 記得排版) #include <unistd.h> ... int main() { ... int test[2]; pipe(test); ... } 補充說明(Supplement): 無 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.240.225.190 ※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1413571172.A.765.html

10/18 15:11, , 1F
後來看了一下 pipe好像是unix才能用的東西
10/18 15:11, 1F

10/18 15:12, , 2F
windows要用shm, socket, event listener之類的來做
10/18 15:12, 2F

10/18 15:17, , 3F
pipe應該是系統層面的東西,win下是CreatePipe..之類的API
10/18 15:17, 3F

10/18 23:12, , 4F
CreatePipe
10/18 23:12, 4F
文章代碼(AID): #1KGM9aTb (C_and_CPP)