开放和fopen函数 [英] open and fopen function
问题描述
可能重复:结果
ç的fopen VS开
什么是C语言的open()和fopen()函数之间的区别?
What is the difference between open() and fopen() in C language?
推荐答案
一类是标准C库的一部分(的fopen
),所以你可以期待它是$ P所有$ psent托管C编译器设置。这个函数返回一个 FILE *
可通过该功能进行操作<文件stdio.h方式>
One is part of the standard c library (fopen
) so you can expect it to be present on all hosted c compiler setups. This function returns a FILE*
which can be operated on by the functions in <stdio.h>
.
其他的(打开
)不是由C标准(不过,我相信这是POSIX标准的一部分),因此只保证指定的系统调用/功能对那些声称支持它选择的平台存在。这将返回 INT
从而重新presents一个文件,这可以使用读
/ <$ C操作$ C>写和其他类似的功能。
The other (open
) is a system call/function not specified by the c standard (however, i believe it is part of the POSIX standard) and therefore only guaranteed to exist on select platforms which claim to support it. This returns an int
which represents a file, this can be operated on using read
/write
and other similar functions.
这篇关于开放和fopen函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!