开发者

C : how can I change from file descriptor to FILE struct and vice versa?

Is there any way to change an int file descriptor to a FIL开发者_运维技巧E struct pointer or/and change FILE* to a file descriptor in C?


The function fdopen() returns a new (FILE *) associated with an open file descriptor.

The function fileno() returns the file descriptor associated with an open FILE *.


Use "fileno()" for FILE->int.

Use "fdopen()" for int->FILE.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜