2022年C语言基础知识归纳2 .pdf
《2022年C语言基础知识归纳2 .pdf》由会员分享,可在线阅读,更多相关《2022年C语言基础知识归纳2 .pdf(9页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、 .1/9 C 语言基础知识1.每个 C 程序有且只有一个主函数main(),且程序必须从main()函数开始执行,并在main()函数中结束。2.在 C 语言中,用e 来表示科学计数法时,规定在e 的前面必须有数字,后面必须为整数。3.用单引号括起来的一个字符常量只能存放一个字符;C 语言中没有字符串变量,只能用字符数组来存储字符串。4.外部变量在编译时由系统分配永久的内存空间,所以外部变量的类型不是自动存储类别。5.在一个函数内的复合语句中定义的变量,只能在这个复合语句范围内有效。6.用 sizeof(int)计算 int 类型数据的字节数。7.C 语言运行时,首先系统检查语法的正误,再运
2、行程序的语法;语言中,可以在一个函数中嵌套一个函数,但是不能在一个函数中定义一个函数;只有在函数外部定义的函数才是外部函数;语言的子程序有过程和函数两种。8.预处理命令行的位置没有规定,只是习惯放在前面;在源文件中的可以有多条预处理命令,但一行只能写一条;宏名的大写只是习惯性的表示;宏替换不仅不占用运行时间还不分配内存空间。9.函数的作用是检查文件是否结束,当结束时返回的值为非零,否则为零。.2/9 10.当定义了数组后,在给其赋值时,不能直接把字符串赋给数组名。11.在赋值表达式中,赋值运算符“”右侧不能为表达式;在求余运算符中的两侧都必须为整型;在强制类型转换时,类型名应用括号括起来。12
3、.静态局部变量,只有当程序结束后,其值才释放。13.当调用函数时,实参是一个数组名,则向函数传送的是数组每一个元素的地址。14.算法的特点为有零个或多个输入,有一个或多个输出,当相同的输入时,其结果相同;算法正确的程序最终一定会结束。15.在 C 语言中,预处理命令行都以“#”开头;当需要时才用#include;预处理的作用就是实现宏定义和条件编译。16.当数组元素的下标超出了定义的下标范围时,系统不给出“下标越界”的字样,而是得出错误的答案,因此在编程时务必检查下标是否越界。17.共用体变量不能作为函数的参数,也不能使函数带回共用体变量。18.指向函数的指针变量的定义形式为:数据类型(*指针
4、变量)();,因此其为指向函数的指针变量。19.用 C 语言编写的代码程序是源程序,只有通过编译、连接才能进行。20.在说明为 static 时,其生存期得到延长,而其作用域并没有改文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码
5、:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6
6、HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 Z
7、M6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档
8、编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C
9、6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1
10、 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3 .3/9 变,在定义后系统会自动帮它赋值为0,static 为关键字不能被用作它
11、用。21.频繁地使用空语句会降低程序的可读性和运算速度。22.运算符%两边都应是整数,赋值语句左边应该是变量,而非表达式,强制转换语句强制类型应加括号。23.在逻辑运算符中,其两侧的运算符对象为任意合法的表达式即可。24.函数 fread(&Iarray,2,16,fp)的功能是,从fp 所指的数据文件中读取 16 次 2 字节的数据存储到数组Iarray 中。25.整个流式文件也可以随机存取数据,C 语言文件中有好多函数可以达到写入数据时,未经输入数据,达到不覆盖的目的,在进行写操作时,系统会自动关闭文件。26.使用 putchar、getchat、puts、gets、printf、scan
12、f 函数时,必须在程序的开头出现包含头文件#include”stdio.h”的命令行,而使用字符串处理函数时,必须在程序的开头出现包含头文件#include”string.h”命令行,而使用数学函数时,必须在程序的开头出现包含头文件#include”math.h”的命令行。27.一个斜杠与小于等于127 任意数字按一个字符计算,一个斜杠与任意一个字符按一个字符计算。28.一个 C 程序可以有一个或多个程序文件,也可以有一个或多个函数,所以一个C 语言程序可以实现多种算法。29.根据 C 语言规定,注释语句可以换行写,并且一个“/*”和文档编码:CG4T8H9S9C6 HN2J1N1C4O1 Z
13、M6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档
14、编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C
15、6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1
16、 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3
17、文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S
18、9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4
19、O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3 .4/9 其后紧跟的第一个“*/”中间的部分是注释内容,且注释内容不参与程序的运行。例如:b=0;/*b=20;给 b 赋值*/则 b=0;。30.sizeof 是求字节数的运算符,包括0,而 strlen 是求字符串的实际长度的函数,不包括0,以 0作为结束。31.在函数声明时,其中的形参变量、个数、函数的类型必须一致
20、。32.C 语言源程序经编译后生成后缀为.obj 的目标程序;C 程序经过编译、连接步骤之后才能形成一个真正可执行的二进制机器指令文件;用C 语言编写的程序称为源程序,它以ASCII代码形式存放在一个文本文件中。并不是源程序中的所有行都参加编译。在条件编译形式下,相关内容只在满足一定条件时才进行编译。33.switch 括号后的表达式可以使任何表达式;case 后的表达式必须是常量表达式,常量表达式中不能出现变量,且类型必须是整数、字符型或枚举型。34.C 程序必须由一个或一个以上的函数组成;函数调用可以作为一个独立的语句存在;若函数有返回值,必须通过return语句返回。35.在 C 语言中
21、,数据只能从实参单向传递给形参,称为“按值”传递。【在实参传递到形参时,是数值传递,而不是地址传递,形参中值的改变不会影响实参中的值。】36.可以用 typedef 声明新的类型名来代替已有的类型名,而不能文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z
22、4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:
23、CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 H
24、N2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM
25、6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编码:CG4T8H9S9C6 HN2J1N1C4O1 ZM6Z4T10A8N3文档编
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年C语言基础知识归纳2 2022 语言 基础知识 归纳
限制150内