易截截图软件、单文件、免安装、纯绿色、仅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/C++中的日期和时间 time_t与struct tm转换

 摘要:
本文从介绍基础概念入手,探讨了在C/C++中对日期和时间操作所用到的数据结构和函数,并对计时、时间的获取、时间的计算和显示格式等方面进行了阐述。本文还通过大量的实例向你展示了time.h头文件中声明的各种函数和数据结构的详细使用方法。
关键字:UTC(世界标准时间),Calendar Time(日历时间),epoch ......

C_转义字符

 源码:
# include <stdio.h>
 
int main()
{
    /* 换行符'\n',用于输出换行 */
    printf("How are you?\n");
    printf("I am fine.\n\n");
 
    /* 横向跳格符'\t',使跳到下一个输出区 */
  ......

C_判断语句if的一般使用

源码:
# include <stdio.h>
     
int main()
{
        int x, y, z, mid, dec;
        printf("请任意输入三个整数:\n");
        scanf("%d %d %d", &x, & ......

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

 源码:
# include <stdio.h>
 
int main( )
{
    int radius;
    double area;
    for(radius = 1; radius <= 10 ; radius++)
    {
        area = 3.1416 * radius * radius;
   ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号