[問題] 沒辦法使用pipe

作者: zelkova (*〞︶〝*)   2014-10-18 02:39:29
開發平台(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):
作者: zelkova (*〞︶〝*)   2014-10-18 15:11:00
後來看了一下 pipe好像是unix才能用的東西windows要用shm, socket, event listener之類的來做
作者: dirkc (3781615)   2014-10-18 15:17:00
pipe應該是系統層面的東西,win下是CreatePipe..之類的API
作者: suhorng ( )   2014-10-18 23:12:00
CreatePipe

Links booklink

Contact Us: admin [ a t ] ucptt.com