当前位置:网站首页>[notes] notes on C language array pointer, structure + two-dimensional array pointer
[notes] notes on C language array pointer, structure + two-dimensional array pointer
2022-06-10 13:50:00 【A egg of maker Association】
Notes
In development For efficiency , Often a large continuous data space is used , Such as : Structure , Array , Two dimensional array , And these are combined , It is another large space , In one bin A single-chip computer with an inch of gold in memory , Very precious , So we often use pointers to operate , One is the efficient use of memory space , One is the efficient operation of the code , There is another one that seems to people who don't understand , Pretend bility is dye-in-the-wood !
Array notes
uint8_t Change[4];
Mask(&Change[sector],bit);
void Mask(uint8_t *mask, uint8_t bit)
{
*mask |= (1 << bit);
}
The above code makes use of C The address of the language array .
==&Change[sector]== Is an array Change Of [sector] Starting address at the beginning , And then use uint8_t *mask The pointer points to the beginning of the address , That is, perform a series of operations on this array , amount to :
(uint8_t *mask)&Change[sector] == Change[sector] ;
The address the pointer points to , That is, the pointer takes the value of this address , The length type is uint8_t.
Take this as an extension :
uint8_t Change[4];
Mask(Change,bit);
void Mask(uint8_t *mask, uint8_t bit)
{
*mask |= (1 << bit);
}
// That is, to the array Change[0] First address value of , operation *mask That's right Change Address operation .
//uint8_t in , When mask exceed 7 in the future , That is to say, to the third party Change[1] operation , And so on .
My notes
Because it's handwritten , I won't type it , Just personal notes , There are structures inside + Two dimensional array pointer , as well as ucosiii Some contents related to the system , Patient people can study , Make a note , You can write code like this in the future , Although it's a little winding , But it's efficient .


边栏推荐
- Notes - simple but adequate series_ The Yapi return parameter data should be an object type problem solving record
- 32. Simple test of raspberry pie serial port communication and ultrasonic module ranging
- Flutter Icon Stack LIsttitle...学习总结3
- [untitled]
- buuctf [PHP]CVE-2019-11043
- net core天马行空系列-可用于依赖注入的,数据库表和c#实体类互相转换的接口实现
- 【FAQ】运动健康服务REST API接口使用过程中常见问题和解决方法总结
- Apple邮箱配置QQ邮箱,163邮箱,edu邮箱,gmail邮箱,获取gmail日历
- win10虚拟机下载安装流程
- 5.8G微波雷达模块使用,5.8G微波雷达模块工作原理和介绍
猜你喜欢

CL210OpenStack操作的故障排除--常见核心问题的故障排除

Qt: accessing controls in other forms
![buuctf [PHP]inclusion](/img/02/d328ed84e4641c09c5b1eba3ac6ea9.png)
buuctf [PHP]inclusion

【Multisim仿真】差分放大电路2

NC|王军/宋默识结合三代测序解析肠道菌群结构变异和功能

软件智能:aaas系统 度量衡及文法的形式规则

【技术分析】探讨大世界游戏的制作流程及技术——前期流程篇

【FAQ】運動健康服務REST API接口使用過程中常見問題和解决方法總結

Solve the problem that win10 virtual machine and host cannot paste and copy each other
![buuctf [PHP]XDebug RCE](/img/e2/bcae10e2051b7e9dce918bf87fdc05.png)
buuctf [PHP]XDebug RCE
随机推荐
leetcode-57-插入区间
[FAQ] résumé des problèmes courants et des solutions lors de l'utilisation de l'interface API rest du Service de santé sportive
leetcode-56-合并区间
【云计算】多云管理平台和公有云两者之间是啥关系?
[golang] when creating a structure with configuration parameters, how should the optional parameters be transferred?
CentOS Linux 已死!Oracle Linux 可能是它的更好替代品
Google Earth engine (GEE) - real time global 10 meter land use / land cover (LULC) data set based on S2 images
Ultra detailed ffmpeg installation and simple use tutorial
erp odoo 权限管理5年系统设置经验小结 真经验分享
Solve the problem that win10 virtual machine and host cannot paste and copy each other
基于FPGA的VGA协议实现
Leetcode 829. 连续整数求和
What is the p value of a gene?
[notes] some records of 74hc573
buuctf [PHP]inclusion
Kotlin练手,以登录为例,Anko简单使用
618. How to prepare for the great promotion
Flutter学习个人总结1
How to locate the hot problem of the game
解决win10虚拟机和主机不能互相粘贴复制的问题