当前位置:网站首页>* and & symbols in C language
* and & symbols in C language
2022-07-02 01:51:00 【java_ prinln】
int a = 10;
int *b = &a;
printf(“%d\n”, a);
printf(“%d\n”, &a);
printf(“%d\n”, b);
printf(“%d\n”, *b);
result
10
6487620
6487620
10
Variable a Essentially represents a storage unit CPU The data in the storage unit is accessed through the address of the storage unit . therefore a Originally represents two values : The address of the storage unit and the data in the storage unit . So there is the opposite sex . To eliminate this ambiguity ,C Language policy a Represents the data in the storage unit ,&a Indicates the address of the storage unit .
a The data in the storage unit can be an ordinary value , It can also be the address of another storage unit , such as :a = &b; The statement is to b The address of the storage unit is stored in a In the storage unit .C Language policy a representative a Data in the storage unit corresponding to the address stored in , That is to visit a Equal to access b, therefore *a Provided through a visit b Means of data in .
a Express a Data in the corresponding storage unit .
&a Express a Address of the corresponding storage unit .
a Express : First , requirement a The data in the corresponding storage unit must be the address of another storage unit .
therefore ,a Represents data in another storage unit .
When a The type of declaration is int when ,a Stored in is an integer value , adopt a You can visit ( To read or modify ) The numerical .
When a The type of declaration is int when ,a Stored in is the address of a storage unit , The data stored in the storage unit is an integer value ; adopt a You can visit ( To read or modify ) The numerical .a == &*a Are the address of the storage unit .
When a The type of declaration is int** when ,a Stored in is the address of a storage unit , The data stored in this storage unit is the address of another storage unit , In addition, this storage unit stores an integer value ; adopt **a You can visit ( To read or modify ) The numerical .
Last , stay C In language, address is called pointer . also , stay C Arrays in language are actually pointers , namely :*a Equate to a[].
边栏推荐
- Learn about servlets
- 【LeetCode 43】236. The nearest common ancestor of binary tree
- With the innovation and upgrading of development tools, Kunpeng promotes the "bamboo forest" growth of the computing industry
- Construction and maintenance of business websites [14]
- 电商系统中常见的9大坑,你踩过没?
- The technology boss is ready, and the topic of position C is up to you
- Medical management system (C language course for freshmen)
- np.where 和 torch.where 用法
- Feature extraction and detection 16 brisk feature detection and matching
- 遊戲思考15:全區全服和分區分服的思考
猜你喜欢
![[Video] visual interpretation of Markov chain principle and Mrs example of R language region conversion | data sharing](/img/56/87bc8fca9ceeab6484f567f7231fdb.png)
[Video] visual interpretation of Markov chain principle and Mrs example of R language region conversion | data sharing

医药管理系统(大一下C语言课设)

TSINGSEE青犀平台如何实现同一节点同时播放多个视频?

1069. Division of convex polygons (thinking, interval DP)

卷积神经网络(包含代码与相应图解)

Matlab uses audioread and sound to read and play WAV files

Unity AssetBundle subcontracting

How to debug apps remotely and online?

Redis有序集合如何使用

SQLite 3 of embedded database
随机推荐
微信小程序中使用tabBar
如何远程、在线调试app?
Another programmer "deleted the library and ran away", deleted the code of the retail platform, and was sentenced to 10 months
三分钟学会基础k线图知识
error: . repo/manifests/: contains uncommitted changes
MPLS experiment operation
开发工具创新升级,鲲鹏推进计算产业“竹林”式生长
What are the affordable Bluetooth headsets? Student party parity Bluetooth headset recommendation
Automatically browse pinduoduo products
The smart Park "ZhongGuanCun No.1" subverts your understanding of the park
The concepts and differences between MySQL stored procedures and stored functions, as well as how to create them, the role of delimiter, the viewing, modification, deletion of stored procedures and fu
Experimental reproduction of variable image compression with a scale hyperprior
[Floyd] post disaster reconstruction
Parted command
Architecture evolution from MVC to DDD
Penser au jeu 15: penser au service complet et au sous - service
What are the skills of spot gold analysis?
What is AQS and its principle
电商系统中常见的9大坑,你踩过没?
Matlab uses audiorecorder and recordblocking to record sound, play to play sound, and audiobook to save sound