当前位置:网站首页>【C语言】变量本质分析
【C语言】变量本质分析
2022-06-12 03:43:00 【嵌入式职场】
目录
1、变量概念
能读能写的内存变量的对象称为变量;
若一旦初始化后不能修改的对象则称为常量;
变量的定义
类型名称 标识符、标识符;
例如:
int i,j,m,n;
char num;
double k;
float fan;
2、变量本质
(1)程序通过变量来申请和命名内存空间 int a = 0
(2)通过变量名访问内存空间
(3)修改变量的方法有???
- 直接,修改变量值;
- 间接,拿到变量的地址编号,可以修改变量;
通过数据类型定义变量;
3、实验验证
- 对变量可读可写;
- 通过变量往内存读写数据;
- 不是向变量读写数据,而是向变量所代表的内存空间中写数据;
变量三要素(名称、大小、作用域)。
#include <stdio.h>
int main(){
//通过变量操作内存
int n = 10;
printf("&n:%d\n",&n);
//通过内存地址修改变量,其中&n = 6356508
*((int*)(6356508)) = 20;
printf("n = %d\n",n);
return 0;
}结果展示:

边栏推荐
- oralce 处理列转行的三种方式 最后生成表格样式数据
- E-commerce middle office system architecture
- FOB,CIF,CFR的区别是什么?
- [Business Research Report] Research Report on super automation technology and application (2022) -- download link attached
- vim命令大全
- Eight fallacies of distributed computing
- Community Conference | the mosn community will release version 1.0 and promote the evolution of the next generation architecture
- MySQL创建用户并授权
- 技术经济与企业管理 复习 第四章
- R language plot visualization: plot visualization of basic 2D histogram, custom setting of color of 2D histogram, and histogram visualization of binary distribution (basic 2D histogram)
猜你喜欢

Batch automated e-mail: Vika Vige table x Tencent Qianfan scene connector has made new moves, and business communication and event marketing only need 3 steps

Concept and introduction of microservice

Convert py file to EXE file

顺序表与链表---初阶

1187_ C language implementation of hysteresis processing
![What is a request response pair called? [repeat] - what is a request response pair called? [duplicate]](/img/65/a214d137e230b1a1190feb03660f2c.jpg)
What is a request response pair called? [repeat] - what is a request response pair called? [duplicate]

tcp 三次握手与四次挥手

LINQ group by and select series - LINQ group by and select collection

E-commerce middle office system architecture

The solution to the error "xxx.pri has modification time XXXX s in the futrue" in the compilation of domestic Kirin QT
随机推荐
Drop down menu dropdown yyds dry inventory of semantic UI
ics-07
(idea)the file size(2.85M) exceeds configured limit(2.56M).Code insight features are not available问题
顺序表与链表-----进阶
R language plot visualization: plot visualization grouped violin plot in R with plot
Solution en cas de défaillance du script Unity
[Yugong series] March 2022 asp Net core Middleware - conditional routing
AI interview bag | Netease mutual entertainment AI Lab artificial intelligence research engineers share on both sides
Successfully solved: warning: there was an error checking the latest version of pip
Sequence list and linked list - primary level
JSP实现银柜台业务绩效考核系统
1186_ Accumulation of embedded hardware knowledge_ Triode and three electrodes
CA證書及密鑰對應用筆記
Message queuing overview
mysql/oracle 以唯一时间为分界,小于等于该时间求和,大于该时间求和
PyTorch中的Sequential、ModuleList和ModuleDict用法总结
Yu Xia looks at win system kernel -- debugging
Three ways for ORALCE to process column to row conversion and finally generate table style data
webpack---优化_缓存
What is a request response pair called? [repeat] - what is a request response pair called? [duplicate]