没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![pptx](https://img-home.csdnimg.cn/images/20210720083543.png)
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![ppt](https://img-home.csdnimg.cn/images/20210720083527.png)
![ppt](https://img-home.csdnimg.cn/images/20210720083527.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![ppt](https://img-home.csdnimg.cn/images/20210720083527.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/release/download_crawler_static/85341470/bg1.jpg)
第
第
2
2
章
章
C
C
数据类
数据类
型
型
![](https://csdnimg.cn/release/download_crawler_static/85341470/bg2.jpg)
22/5/10 2/26
本章学习内容
本章学习内容
常量和变量,整型和实型
常量和变量,整型和实型
标识符命名,变量的定义和赋值
标识符命名,变量的定义和赋值
计算数据类型占用内存空间的大小
计算数据类型占用内存空间的大小
![](https://csdnimg.cn/release/download_crawler_static/85341470/bg3.jpg)
22/5/10 3/26
2.1
2.1
常量与变量
常量与变量
C
C
语言程序处理的数据形式
语言程序处理的数据形式
–
常量(
常量(
constant
constant
)
)
在程序中不能改变其值的量
在程序中不能改变其值的量
–
变量(
变量(
variable
variable
)
)
其值在程序执行过程中是可以改变的
其值在程序执行过程中是可以改变的
![](https://csdnimg.cn/release/download_crawler_static/85341470/bg4.jpg)
22/5/10 4/26
一个简单的
一个简单的
C
C
程序例子
程序例子
#include <stdio.h>
/* 函数功能:计算两个整数相加之和
入口参数:整型数据 a 和 b
返回值: 整型数 a 和 b 之和
*/
int Add(int a, int b)
{
return (a + b);
}
/* 主函数 */
main()
{
int x, y, sum = 0;
printf("Input two integers:");
scanf("%d%d", &x, &y); /* 输入两个整型数 x 和 y*/
sum = Add(x, y); /* 调用函数 Add 计算 x 和 y 相加之和 */
printf("sum = %d\n", sum); /* 输出 x 和 y 相加之和 */
}
并列的两个函数
其中主函数是
程序的入口
程序注释
编译预处理命令
![](https://csdnimg.cn/release/download_crawler_static/85341470/bg5.jpg)
22/5/10 5/26
C
C
程序常见符号分类
程序常见符号分类
关键字(
关键字(
Keyword
Keyword
)
)
–
又称保留字(
又称保留字(
C
C
Reserved Word
Reserved Word
)
)
A word that has special meaning in C
A word that has special meaning in C
标识符(
标识符(
Identifier
Identifier
)
)
–
系统预定义标识符(
系统预定义标识符(
C Standard
C Standard
Identifier
Identifier
)
)
A word having special meaning but
A word having special meaning but
may be redefined (but is not
may be redefined (but is not
recommended!!)
recommended!!)
–
用户自定义标识符
用户自定义标识符
变量,函数名,
变量,函数名,
……
……
剩余24页未读,继续阅读
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/77de0adf71de4b419dfa799bbafeea65_wxg520cxl.jpg!1)
wxg520cxl
- 粉丝: 23
- 资源: 3万+
![benefits](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-1.c8e153b4.png)
下载权益
![privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-2.ec46750a.png)
C知道特权
![article](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-3.fc5e5fb6.png)
VIP文章
![course-privilege](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-4.320a6894.png)
课程特权
![rights](https://csdnimg.cn/release/downloadcmsfe/public/img/vip-rights-icon.fe0226a8.png)
开通VIP
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)