看板 C_and_CPP 關於我們 聯絡資訊
開發平台(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
zelkova: 後來看了一下 pipe好像是unix才能用的東西 10/18 15:11
zelkova: windows要用shm, socket, event listener之類的來做 10/18 15:12
dirkc: pipe應該是系統層面的東西,win下是CreatePipe..之類的API 10/18 15:17
suhorng: CreatePipe 10/18 23:12