易截截图软件、单文件、免安装、纯绿色、仅160KB

《C程序设计语言》读书笔记20091106

     书中有几个问题有点模糊。记录一下。
    
Answer to Exercise 1-7
Write a program to print the value of EOF .
 
#include <stdio.h>
 
int main(void)
{
  printf("The value of EOF is %d\n\n", EOF);
 
  return 0;
}
EOF在stdio.h中的定义为#define EOF (-1)
其中()被忽略,只使用-1。


相关文档:

C_数据类型转换

 源码:
# include <stdio.h>
 
int main()
{
    /* 定义变量并赋初值 */
     int    a = 5;       
    char   c = 'a';   // 'a'的ASC码的值为97
    ......

C_使用break和continue控制循环语句

 源码:
# include <stdio.h>
 
int main( )
{
    int radius;
    double area;
    for(radius = 1; radius <= 10 ; radius++)
    {
        area = 3.1416 * radius * radius;
   ......

C_在switch

 源码:
# include <stdlib.h>
# include <stdio.h>
 
int main()
{
    int month;
    int day;
     
    printf("please input the month number: ");
    scanf("%d", &mo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号