newechoes/src/content/理解计算机/c/c语言二级考点.md
2025-04-19 01:06:52 +08:00

102 lines
1.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: c语言二级考点
date: 2024-09-11T15:53:30Z
tags: []
---
### 结构化语言
结构化语言的特点就是包括三种基本结构(顺序结构,选择结构,循环结构)
使用了结构化语言程序就具有结构化
#### 特点
1. 模块化
2. 自顶往下
3. 逐步求精
4. 限制使用go语句
### 程序执行过程
1. 源程序(`.c`)
编译
2. 目标文件(`.obj`)
链接
3. 执行文件(`.exe`)
执行
### 常量
#### 整数
* `0`开头的是8进制
* `0x`开头的是16进制
#### 小数
* `0.7`=`.7`
* `7.0`=`7.`
* 科学计数`6E6`
E的前后必须有数后面必须为整数
#### 字符型
##### 普通字符
c语言只有单字符
A=65
a=97
##### 转义字符
* 一般转义字符:`\n` `\t`
* 八进制转义字符:`\0`​开头,`\0343`
* 十六进制转义字符:`\0x`​开头,`\0xaf`
### 注释
开头:/*
结尾:*/
### 三段论
表达式=数值
### 标识符
#### 关键字
* int
* float
* acse
不能作为用户标识符
#### 预定义标识符
* printf
* scanf
* define
可以作为用户标识符
#### 用户标识符
* int a
* int _a
#### 规则
1. 字母,数字,下划线
2. 不能以数字开头