原帖由 [bold][underline]cosdos[/underline][/bold] 于 2007-12-13 12:58 发表 [url=http://bbs.bc-cn.net/redirect.php?goto=findpost&pid=1146097&ptid=192190]

[/url]
字符一般占一节,
我想楼主用的是 TC,我的编译器上肯定是4。
'\n' 是一个常量,而不是 char 类型。
.
标准:
6.5.3.4 The sizeof operator
3 When applied to an operand that has type char, unsigned char,or signed char,
(or a qualified version thereof) the result is 1.
也就是说,任何编译器sizeof(char)的结果都是1