当前位置:网站首页>关键字分类与第一个C程序
关键字分类与第一个C程序
2022-06-10 03:04:00 【云朵c】
关键字分类
C语言一共有多少个关键字呢?一般的书上,都是32个,但是这个都是c90(c89)的标准。其实c99后又新增了5个关键字。不过,目前主流的编译器,对c99支持的并不好,所以这里认为是32个,也列举32个。
| 关键字 | 说明 |
|---|---|
auto | 声明自动变量 |
short | 声明短整型变量或函数 |
int | 声明整型变量或函数 |
long | 声明长整型变量或函数 |
float | 声明单精度浮点型变量或函数 |
double | 声明双精度浮点型变量或函数 |
char | 声明字符型变量或函数 |
struct | 声明结构体变量或函数 |
union | 声明共用数据类型 |
enum | 声明枚举类型 |
typedef | 重命名数据类型 |
const | 声明只读变量 |
unsigned | 声明无符号类型变量或函数 |
signed | 声明有符号类型变量或函数 |
extern | 声明变量是在其它文件中声明 |
register | 声明寄存器变量 |
static | 声明静态变量 |
volatile | 说明变量在程序执行中可被隐含地改变 |
void | 声明函数无返回值或无参数,声明无类型指针 |
if | 条件语句 |
else | 条件语句否定分支(与if连用) |
switch | 用于开关语句 |
case | 开关语句分支 |
for | 一种循环语句 |
do | 循环语句的循环体 |
while | 循环语句的循环条件 |
goto | 无条件跳转语句 |
continue | 结束当前循环,开始下一轮循环 |
break | 跳出当前循环 |
default | 开关语句的“其它”分支 |
sizeof | 计算数据类型长度 |
return | 子程序返回语句(可以带参数,也可以不带参数)循环条件 |
第一个C程序
//vs2019中建立项目
//编写第一个C程序"hello world!"
#include <stdio.h>
int main()
{
printf("hello world!\n");
return 0;
}
运行程序的方式,可以用vs直接启动
当然,也可以在vs项目中,找到代码生成的二进制可执行程序,双击即可。
所以:我们的角色是写代码,编译器的角色是把文本代码编程二进制可执行程序。
双击?不就是windows下启动程序的做法吗?
那么启动程序的本质是什么?将程序数据,加载到内存中,让计算机运行!
那么为什么要加载到内存中呢?是因为快!因为CPU直接在硬盘中读取数据太慢!!
那么在加载到内存中之前程序在哪里呢?在硬盘当中!
边栏推荐
- Xmake v2.6.6 发布,分布式编译和缓存支持
- 使用webdriver时不显示浏览器运行
- 多线程的使用场景
- Technology dry goods | linkis practice: analysis of new engine implementation process
- In the new year of hybrid, does BYD really want to reverse its rating?
- TiDB经验分享01
- 零拷贝原理详解
- 86. (leaflet house) leaflet military plotting - collection of linear arrows
- Arduino与Processing串口通信(split函数)
- bad interpreter:No such file or directory
猜你喜欢
随机推荐
Compilation error of GStreamer source code in yocto image construction, causes and Solutions
Wang Xing, Zhang Yong, Xu Lei, who can win the local e-commerce?
C # extension method (this in the method parameter)
NPM error class extends value undefined is not a constructor or null
剑指 Offer 24. 反转链表
TiDB经验分享01
鲁棒性问题——醍醐灌顶之作
Use of golang microservice instances protobuf and grpc
Knight Moves
1px问题
Tensorflow. Mobilenet for getting started with JS
P1516 青蛙的约会(扩欧)
Three ways to realize application communication in Qiankun (props, initglobalstate, socket.io)
Arduino and processing serial port communication (split function)
leetcode:305. 岛屿的数量
The hcie Routing & switching test is postponed to December 31, 2022
TS 38.304
22.对于BFS的思考
Luogu p2678 stone jumping
uwsgi loading shared libraries:libicui18n.so.58 异常处理









