就像INT型定义有的机器和SHORT是一样的,有些定义和LONG一样。所以大家有些分歧
呵呵
楼主能回复下不
虽然现在的我什么都不明白,但总有一天,我将包容一切,让优秀变成一种习惯。。。。。。。。。。。。
大家这样就知道到底是一个转义字符\n 还是一个字符串\n了
printf("%c",'\n');
getch();
printf("%d",sizeof('\n'));
getch();
应该和字符型数据在内存储器中的存储方式有关吧
[此贴子已经被作者于2005-11-22 16:13:58编辑过]
[此贴子已经被作者于2005-11-22 16:15:04编辑过]
我认为这是编译器的问题,wintc有着许多不严谨的地方,比如指针方面,不经指向可以直接使用,如果这样,可能导致系统不安全.
至于这问题,我在两种编译器中运行有两结果.
在wintc中为2
在vc++中为1
A character written between single quotes represents an integer value equal to the numerical value of the character in the machine's character set. This is called a character constant, although it is just another way to write a small integer. So, for example, 'A' is a character constant; in the ASCII character set its value is 65, the internal representation of the character A. Of course, 'A' is to be preferred over 65: its meaning is obvious, and it is independent of a particular character set.