【发布时间】:2013-08-12 18:02:02
【问题描述】:
我正在使用代码块。
下面是C语言的程序:
/*to find the value of EOF ( End Of the File ) Number */
#include<stdio.h>
int main()
{
printf("The EOF value is: %d %5ld",EOF, EOF);
/*when EOF specified in %d specifier it is giving the value as -1, but if its
given %ld then a number 4294967295 is printed on the console?*/
return 0;
}
正如我在节目的 cmets 中所说的:
- 当在 %d 说明符中指定 EOF 时,它给出的值为 -1,但如果它 给定 %ld 那么控制台上会打印一个数字 4294967295?
我在 HP 上使用 64 位 Linux 操作系统。 [如果编译器为整数、浮点数和长整数分配内存很重要]
【问题讨论】:
标签: c formatting