C++ 不能通过管道';s写入结束为文件描述器
管道的写入结束文件描述符是C++ 不能通过管道';s写入结束为文件描述器,c++,tcl,C++,Tcl,管道的写入结束文件描述符是int,但有些函数接受void*作为文件句柄。我需要将管道写入端传递给它。如何将一种类型的文件句柄转换为另一种类型?阅读时,您似乎只需传递文件描述符: Tcl_MakeFileChannel(reinterpret_cast<void*>(fd), ...); Tcl_MakeFileChannel(reinterpret_cast(fd),…); 您可能还想读取。读取似乎只需传递文件描述符: Tcl_MakeFileChannel(reinterpre
int
,但有些函数接受void*
作为文件句柄。我需要将管道写入端传递给它。如何将一种类型的文件句柄转换为另一种类型?阅读时,您似乎只需传递文件描述符:
Tcl_MakeFileChannel(reinterpret_cast<void*>(fd), ...);
Tcl_MakeFileChannel(reinterpret_cast(fd),…);
您可能还想读取。读取似乎只需传递文件描述符:
Tcl_MakeFileChannel(reinterpret_cast<void*>(fd), ...);
Tcl_MakeFileChannel(reinterpret_cast(fd),…);
您可能还想阅读。这很难看,但在Windows上必须是这种方式,操作系统文件句柄的大小为指针类型。这很难看,但在Windows上必须是这种方式,操作系统文件句柄的大小为指针类型。