当前位置:网站首页>"." in the structure of C language And "- & gt;" Differences between
"." in the structure of C language And "- & gt;" Differences between
2022-06-24 03:53:00 【Good pie notes】
The same thing : Both operators are binary operators , And its operator is the name of the structure member .
Difference :“ . ” The operand to the left of the operator is a “ Structure ” The expression of , and “ -> ” The operand to the left of the operator is a pointer to the structure .
example :
typedef struct
{
int num;
float score;
char name[10];
}STUDENT;
STUDENT temp;
STUDENT *p = &temp;
ad locum temp.score Represents the structure temp The members of score.
p->score Stands for pointing to temp Structural members score The pointer to .
For convenience and intuition ,C Language allows to put (*temp).score use p->score To replace . That is to say p->score Equivalence and (*temp).score.
So in the structure “ . ” and “ -> ” The usage of is similar to , But not equivalent .
边栏推荐
- hprofStringCache
- On game safety (I)
- ClickHouse(02)ClickHouse架构设计介绍概述与ClickHouse数据分片设计
- General scheme for improving reading and writing ability of online es cluster
- Using RDM (Remote Desktop Manager) to import CSV batch remote
- 黑帽SEO实战之通用301权重pr劫持
- [numpy] numpy's judgment on Nan value
- How to install CentOS 6.5 PHP extension
- Modstartcms enterprise content site building system (supporting laravel9) v4.2.0
- Halcon knowledge: contour operator on region (2)
猜你喜欢

黑帽SEO实战搜索引擎快照劫持

SQL注入绕过安全狗思路一

Modstartcms theme introductory development tutorial

讲讲我的不丰富的远程办公经验和推荐一些办公利器 | 社区征文
![[Numpy] Numpy对于NaN值的判断](/img/aa/dc75a86bbb9f5a235b1baf5f3495ff.png)
[Numpy] Numpy对于NaN值的判断

An accident caused by a MySQL misoperation, and the "high availability" cannot withstand it!

ModStartCMS 主题入门开发教程

Installation of pytorch in pycharm

618大促:手机品牌“神仙打架”,高端市场“谁主沉浮”?

你了解TLS协议吗?
随机推荐
ClickHouse Buffer
Do you understand TLS protocol?
Grpc: how to make grpc provide swagger UI?
Disk partition extension using graphical interface and PowerShell code
Technical dry goods - how to use AI technology to accurately identify mining Trojans
A figure showing the price and expense structure of Tencent cloud real-time audio and video TRTC
浅谈游戏安全 (一)
Hprof information in koom shark with memory leak
Grpc: how to make grpc provide restful API services?
Optimization of digital transformation management of procurement platform in construction industry
左滑从小窗到大窗口DispatchFrameLayout
Discussion on the introduction principle and practice of fuzzy testing
Several key tools for cloud native implementation
Modstartcms theme introductory development tutorial
LeetCode 2006. Number of pairs whose absolute value of difference is k
Create a telepresence USB drive using the DD command
Interpreting Tencent cloud product experience through user experience elements
How to handle the uplink and downlink silence of TRTC
What should I pay attention to when choosing a data center?
Unable to access the CVM self built container outside the TKE cluster pod