首页 > 试题广场 >

以二进制方式打开一个文件的方法是?

[单选题]
以二进制方式打开一个文件的方法是?
  • FILE *f = fwrite("test.bin", "b");
  • FILE *f = fopenb("test.bin", "w");
  • FILE *f = fopen("test.bin", "wb");
  • FILE *f = fwriteb("test.bin");
读写w,二进制b
发表于 2019-11-04 15:20:07 回复(4)
在C语言中, fopen()函数用于打开指定路径的文件,返回指向该文件的指针: FILE  * fopen( const   char  * path, const   char  * mode)
fwrite()函数将内存中的数据写入文件,返回写入数据字节数: size_t  fwrite( const   void * buffer,  size_t  size,  size_t  count,  FILE * stream);
发表于 2017-03-22 22:48:13 回复(2)

以二进制方式打开,在读写方式上加上b

发表于 2017-08-12 14:08:47 回复(0)

File access mode flag "b" can optionally be specified to open a file in binary mode. This flag has no effect on POSIX systems, but on Windows, for example, it disables special handling of '\n' and '\x1A'.
发表于 2021-03-25 16:56:10 回复(0)
B\D 的fopenb fwriteb是什么鬼。好似根本没这两个API
编辑于 2018-02-10 10:13:57 回复(0)
C以二进制打开文件方式得加上b
发表于 2015-05-14 21:42:02 回复(3)
B,C函数
发表于 2015-04-16 19:37:43 回复(1)