utf8_fopen中'wt'的含义是什么? [英] What is the meaning of 'wt' in utf8_fopen
问题描述
你能告诉我utf8_fopen输入参数中的''t'是什么意思
?
utf8_fopen(a_file," wt")
谢谢。
si ************ ***@gmail.com 写道:
你能否告诉我输入参数中't'的平均值是什么? />
在utf8_fopen?
utf8_fopen(a_file," wt")
不知道是什么heck''utf8_fopen'',但是''fopen''wt意味着
在文本模式下打开。
V
-
请删除资金''A'在通过电子邮件回复时
我没有回复最热门的回复,请不要问
Victor Bazarov写道:
si *** ************ @ gmail.com 写道:
你能告诉我''是什么意思''在utf8_fopen的输入中
参数?
utf8_fopen(a_file," wt")
不确定'utf8_fopen'是什么,但在''fopen''" wt"表示
在文本模式下打开。
不,它是未定义的。
来自C草案标准:
7.19.5.3 fopen功能
概要
[#1]
#include< ; stdio.h>
FILE * fopen(const char * filename,
const char * mode);
[#3]参数mode指向一个字符串。如果字符串是
以下之一,则文件在指示的
模式下打开。否则,行为是未定义的.214)
r用于阅读的打开文本文件
w截断为零长度或创建用于写入的文本文件
a追加;打开或创建文本文件,以便在结束时写入
文件
rb打开二进制文件以供阅读
wb截断为零长度或创建二进制文件
写作
ab append;打开或创建二进制文件以便在结束时写入 -
of-file
r +打开文本文件进行更新(读写)
w + truncate零长度或创建文本文件以进行更新
a + append;打开或创建文本文件进行更新,写在
文件结尾
r + b或rb +打开二进制文件进行更新(读写)
w + b或wb +截断到零长度或创建二进制文件进行更新
a + b或ab + append;打开或创建二进制文件进行更新,在文件结尾处写入
214如果字符串以上述序列之一开头,则
实现可能会选择忽略剩余的
字符,或者它可能会使用它们来选择不同的
种类的文件(其中一些可能不符合
7.19.2中的属性。
Brian
默认用户写道:
Victor Bazarov写道:
> si *************** @ gmail.com 写道:
>>你能否告诉我在utf8_fopen输入
参数中't'的意思是什么?
utf8_fopen(a_file," wt")
不确定'utf8_fopen'是什么,但在''fopen''" wt"表示
在文本模式下打开以进行写入。
不,它是未定义的。
来自C草案标准:
[..]
无论如何。 wt是指wt。看起来非常像
"在TEXT模式下打开WRITE。
V
-
请在通过电子邮件回复时删除资金''A'
我没有回复最热门的回复,请不要问
Hi,
Can you please tell me what is the mean of ''t'' in the input parametre
in utf8_fopen?
utf8_fopen( a_file, "wt" )
Thank you.
si***************@gmail.com wrote:Can you please tell me what is the mean of ''t'' in the input parametre
in utf8_fopen?
utf8_fopen( a_file, "wt" )Not sure what the heck ''utf8_fopen'' is, but in ''fopen'' "wt" means
open for Write in Text mode.
V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask
Victor Bazarov wrote:
si***************@gmail.com wrote:Can you please tell me what is the mean of ''t'' in the input
parametre in utf8_fopen?
utf8_fopen( a_file, "wt" )
Not sure what the heck ''utf8_fopen'' is, but in ''fopen'' "wt" means
open for Write in Text mode.No, it''s undefined.
From the C draft standard:
7.19.5.3 The fopen function
Synopsis
[#1]
#include <stdio.h>
FILE *fopen(const char * filename,
const char * mode);
[#3] The argument mode points to a string. If the string is
one of the following, the file is open in the indicated
mode. Otherwise, the behavior is undefined.214)
r open text file for reading
w truncate to zero length or create text file for writing
a append; open or create text file for writing at end-of-
file
rb open binary file for reading
wb truncate to zero length or create binary file for
writing
ab append; open or create binary file for writing at end-
of-file
r+ open text file for update (reading and writing)
w+ truncate to zero length or create text file for update
a+ append; open or create text file for update, writing at
end-of-file
r+b or rb+ open binary file for update (reading and writing)
w+b or wb+ truncate to zero length or create binary file for update
a+b or ab+ append; open or create binary file for update, writing
at end-of-file
214If the string begins with one of the above sequences, the
implementation might choose to ignore the remaining
characters, or it might use them to select different
kinds of a file (some of which might not conform to the
properties in 7.19.2).
Brian
Default User wrote:Victor Bazarov wrote:
>si***************@gmail.com wrote:>>Can you please tell me what is the mean of ''t'' in the input
parametre in utf8_fopen?
utf8_fopen( a_file, "wt" )
Not sure what the heck ''utf8_fopen'' is, but in ''fopen'' "wt" means
open for Write in Text mode.
No, it''s undefined.
From the C draft standard:
[..]Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".
V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask
这篇关于utf8_fopen中'wt'的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!