当前位置:网站首页>DAY 3 数组,前置后置,字符空间,关键词和地址指针
DAY 3 数组,前置后置,字符空间,关键词和地址指针
2022-06-26 09:34:00 【51CTO】
1.不能用变量来指定数组的大小
例:
int a=10;
int arr[a]={0};
此程序是错误的。



由以上可见,空格和默认添加的“\d”也分别算一个字符。但是注意的是"\0"不算字符串的长度。但空格算一个字符。
2.求字符所占空间

3.前置和后置

4.关键词

struct 结构体关键字
union 联合体/共用体
typedef 类型定义
static int a 静态的局部变量a,修饰局部变量时,会使局部变量的生命周期变长了
不使用static时:

使用static时:

static 修饰全局变量时,会改变全局变量的作用域,使全局变量只能在其所在的源文件中使用。
例如:
在源文件test_1中:
int change_1=25;
在源文件test_2中:
extern int chang_1
此时chang_1可以在test_2中使用,但如果是
static int change_1=25;
此时chang_1不可以在test_2中使用
5.#define定义常量和宏

6.地址指针

边栏推荐
猜你喜欢
![Logical English structure [key points]](/img/4b/52a666ed01087adbc5fa4f9e1db393.png)
Logical English structure [key points]

install realsense2: The following packages have unmet dependencies: libgtk-3-dev

【AAAI 2021】Few-Shot One-Class Classification via Meta-Learning 【FSOCC via Meta-learning】

Badge collection 6:api\_ Use of level

MapReduce&Yarn理论

c语言语法基础之——指针(字符、一维数组) 学习

Deep learning (tentsorflow2. version) three good student performance problems (1)

Regular expression learning

Spark based distributed parallel processing optimization strategy - Merrill Lynch data

逻辑英语结构【重点】
随机推荐
Redis notes (12) - single thread architecture (non blocking IO, multiplexing) and multiple asynchronous threads
Speed test of adding, deleting, modifying and querying 5million pieces of data in a single MySQL table
节流,防抖,new函数,柯里化
Detailed explanation of the network security competition questions (2) of the 2021 national vocational college skills competition (secondary vocational group)
How to solve the problem that NVIDIA model cannot be viewed by inputting NVIDIA SMI and quickly view NVIDIA model information of computer graphics card
What you need to know to test -- URL, weak network, interface, automation
How to correctly open the USB debugging and complete log functions of Huawei mobile phones?
Edge computing is the sinking and extension of cloud computing capabilities to the edge and user sides
Classified catalogue of high quality sci-tech periodicals in the field of computing
Badge series 5: use of codecov
点击遮罩层关闭弹窗
Leetcode basic calculator 224 227. follow up 394
pcl install
LeetCode 基本计算器 224. 227. follow up 394
The most complete and simple nanny tutorial: deep learning environment configuration anaconda+pychart+cuda+cudnn+tensorflow+pytorch
Leetcode refers to offer II 091 Paint house - modify in place
Throttling, anti chattering, new function, coriolism
使用递归或while循环获取父/子层级结构的名称
软件测试---如何选择合适的正交表
Kubernetes cluster deployment (v1.23.5)