以下是引用pgy在2009-10-24 18:41:49的发言:
虽然我是小菜鸟,但我可是很严谨的哟
我举的例子或改的程序如果在我的编译器错误的话,我是不会发上去的
所以一般意义而言,可能我观点有问题(因为能力有限),但代码一般不会有问题。
哪怕是
include ...
虽然我是小菜鸟,但我可是很严谨的哟
我举的例子或改的程序如果在我的编译器错误的话,我是不会发上去的
所以一般意义而言,可能我观点有问题(因为能力有限),但代码一般不会有问题。
哪怕是
include ...
不要盲从编译器,编译器是软件。是软件总会有Bug。遇到问题了翻标准或者文档。下面摘自C99标准,明显看出不允许空的字符常量。
6.4.4.4 Character constants
Syntax
1 character-constant:
' c-char-sequence '
L' c-char-sequence '
c-char-sequence:
c-char
c-char-sequence c-char
c-char:
any member of the source character set except
the single-quote ', backslash \, or new-line chara
escape-sequence
escape-sequence:
simple-escape-sequence
octal-escape-sequence
hexadecimal-escape-sequence
universal-character-name
simple-escape-sequence: one of
\' \" \? \\
\a \b \f \n \r \t \v
octal-escape-sequence:
\ octal-digit
\ octal-digit octal-digit
\ octal-digit octal-digit octal-digit
hexadecimal-escape-sequence:
\x hexadecimal-digit
hexadecimal-escape-sequence hexadecimal-digit
Syntax
1 character-constant:
' c-char-sequence '
L' c-char-sequence '
c-char-sequence:
c-char
c-char-sequence c-char
c-char:
any member of the source character set except
the single-quote ', backslash \, or new-line chara
escape-sequence
escape-sequence:
simple-escape-sequence
octal-escape-sequence
hexadecimal-escape-sequence
universal-character-name
simple-escape-sequence: one of
\' \" \? \\
\a \b \f \n \r \t \v
octal-escape-sequence:
\ octal-digit
\ octal-digit octal-digit
\ octal-digit octal-digit octal-digit
hexadecimal-escape-sequence:
\x hexadecimal-digit
hexadecimal-escape-sequence hexadecimal-digit