'\ 0'和0之间的区别 [英] Difference between '\0' and 0
问题描述
大家好,
如果c是char,那么
c =''\ 0''之间是否存在差异br />
和
c = 0
?
问候,
八月
Hello all,
If c is a char then is there any difference between
c = ''\0''
and
c = 0
?
Regards,
August
推荐答案
August Karlstrom写道:
August Karlstrom wrote:
大家好,
如果c是一个字符,那么
之前是否存在差异?=''\ 0''
和
> c = 0
?
Hello all,
If c is a char then is there any difference between
c = ''\0''
and
c = 0
?
无论c是什么。
'' \\ 0''和0都是常量主表达式
类型为int且值为零。
-
pete
It doesn''t matter what c is.
''\0'' and 0 are both constant primary expressions
of type int and value zero.
--
pete
August Karlstrom写道:
August Karlstrom wrote:
大家好,
如果c是一个字符然后是否有任何区别
c =''\ 0''
和
c = 0 >
?
问候,
8月
Hello all,
If c is a char then is there any difference between
c = ''\0''
and
c = 0
?
Regards,
August
呃,实际上,在C中,char是一个8位整数(不是所有)。
''\ 0''的ASCII值是0.So c =''\ 0''等于c = 0.在许多程序中,我们使用char代替<当整数很小时,
of int。
Er,in fact,in C, a char is an 8-bit integer(not all).The ASCII value of
''\0'' is 0.So c=''\0'' equals to c=0 .In many programs,we use char instead
of int when the integer is small.
pete写道:
August Karlstrom写道:
August Karlstrom wrote:
大家好,
如果c是char,那么
c =''\'''之间是否有任何区别
c = 0
?
Hello all,
If c is a char then is there any difference between
c = ''\0''
and
c = 0
?
无论c是什么。
''\ 0''和0都是int类型和值零的常量主表达式。
It doesn''t matter what c is.
''\0'' and 0 are both constant primary expressions
of type int and value zero.
Lint程序Splint认为存在差异:
The Lint program Splint thinks there is a difference:
这篇关于'\ 0'和0之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!