当前位置:网站首页>"." 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 .
边栏推荐
- 你了解TLS协议吗?
- Record the creation process of a joke widget (II)
- Brief ideas and simple cases of JVM tuning - how to tune
- 3. go deep into tidb: perform optimization explanation
- ClickHouse(02)ClickHouse架构设计介绍概述与ClickHouse数据分片设计
- 高斯光束及其MATLAB仿真
- Common content of pine script script
- Summary of common problems of real-time audio and video TRTC - quality
- Protect your system with fail2ban and firewalld blacklists
- Tencent cloud ASR product -php realizes the authentication request of the extremely fast version of recording file identification
猜你喜欢

黑帽SEO实战之通用301权重pr劫持

Old popup explorer Exe has stopped working due to problems. What should I do?

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

Black hat SEO actual combat search engine snapshot hijacking

你了解TLS协议吗?

Black hat SEO actual combat directory wheel chain generates millions of pages in batch

黑帽实战SEO之永不被发现的劫持

在pycharm中pytorch的安装

Halcon knowledge: contour operator on region (2)

Ar 3D map technology
随机推荐
Idea 1 of SQL injection bypassing the security dog
[Numpy] Numpy对于NaN值的判断
[numpy] numpy's judgment on Nan value
Rasa 3.x 学习系列-Rasa 3.2.0 新版本发布
Summary of rust high concurrency programming
Tencent cloud ASR product -php realizes the authentication request of the extremely fast version of recording file identification
Gaussian beam and its matlab simulation
Summary of common SSH commands
Web penetration test - 5. Brute force cracking vulnerability - (1) SSH password cracking
Clickhouse (02) Clickhouse architecture design introduction overview and Clickhouse data slicing design
Web penetration test - 5. Brute force cracking vulnerability - (7) MySQL password cracking
Self built DNS to realize the automatic intranet resolution of tke cluster apiserver domain name
web rdp Myrtille
web渗透测试----5、暴力破解漏洞--(1)SSH密码破解
web渗透测试----5、暴力破解漏洞--(2)SNMP密码破解
How to gracefully handle and return errors in go (1) -- error handling inside functions
讲讲我的不丰富的远程办公经验和推荐一些办公利器 | 社区征文
How to restore the default route for Tencent cloud single network card machine
Exploration of web application component automatic discovery
The importance of the computer room to the stable operation of the server