当前位置:网站首页>[C language] analysis of variable essence
[C language] analysis of variable essence
2022-06-12 03:48:00 【Embedded workplace】
Catalog
1、 Variable concept
Objects that can read and write memory variables are called variables ;
Objects that cannot be modified once initialized are called constants ;
Definition of variables
Type the name identifier 、 identifier ;
for example :
int i,j,m,n;
char num;
double k;
float fan;
2、 The nature of variables
(1) The program uses variables to apply for and name memory space int a = 0
(2) Access memory space by variable name
(3) There are ways to modify variables ???
- direct , Change the value of the variable ;
- indirect , Get the address number of the variable , You can modify variables ;
Define variables by data types ;
3、 Experimental verification
- Read and write variables ;
- Read and write data to memory through variables ;
- Not reading and writing data to variables , Instead, write data to the memory space represented by the variable ;
Three elements of variable ( name 、 size 、 Scope ).
#include <stdio.h>
int main(){
// Operating memory through variables
int n = 10;
printf("&n:%d\n",&n);
// Modify variables by memory address , among &n = 6356508
*((int*)(6356508)) = 20;
printf("n = %d\n",n);
return 0;
}Result display :

边栏推荐
- DS18B20数字温度计 (一) 电气特性, 供电和接线方式
- Pat class B 1067 trial password (20 points)
- The rise of another domestic mobile phone chip is close to the height reached by Huawei
- 【C语言】封装接口(加减乘除)
- 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
- Unity脚本出現missing時的解决方法
- [C language] dynamic memory allocation
- 电商中台系统架构
- Page crash handling method
- Network tester operation manual renix rack management
猜你喜欢

【mysql】mysql安装

MongoDB精华总结

Paper recommendation: relicv2, can the new self supervised learning surpass supervised learning on RESNET?

【C语言】程序的内存四区模型

KV storage separation principle and performance evaluation of nebula graph

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

Goodbye to excel and PPT, I found a better visual fool software

Implementation of fitness club management system based on SSH

Data flow diagram of Flink

oralce 处理列转行的三种方式 最后生成表格样式数据
随机推荐
根据变换矩阵进行图像拼接
Eight fallacies of distributed computing
Leetcode 6[finding rules] Z-transform the leetcode path of heroding
What is a request response pair called? [repeat] - what is a request response pair called? [duplicate]
顺序表与链表---初阶
sed命令
(idea)the file size(2.85M) exceeds configured limit(2.56M). Code insight features are not available
Summary -day11
【mysql】mysql安装
双目标定学习资料整理
Network tester operation manual renix rack management
[Yugong series] March 2022 asp Net core Middleware - conditional routing
Successfully solved: warning: there was an error checking the latest version of pip
[Bank Research Report] technology enabled retail finance carbon neutral development report (2022) - download link attached
Yyds dry inventory MySQL learning - how transactions are isolated
Computer configuration suggestions for learning modeling
DS18B20数字温度计 (一) 电气特性, 供电和接线方式
[data recovery in North Asia] data recovery in which the logical volume of the server is changed and the file system is damaged due to system reinstallation
Evolution and practice of Unicom real-time computing platform
数据库精选 60 道面试题