当前位置:网站首页>[C language syntax] the difference between typedef struct and struct
[C language syntax] the difference between typedef struct and struct
2022-07-06 05:47:00 【Python's path to immortality】
typedef It means type definition .
typedef struct It's for the convenience of using this structure .
The specific difference is :
if struct node{ } If you define the structure in this way . In defining node Structure variable of , It needs to be written like this :struct node n;
If use typedef, It can be written like this :typedef struct node{}NODE; . You can write this when applying for variables :NODE n; It's the same thing as NODE yes node Another name for . The difference is that when used , Can you omit struct This keyword .
.
.
.
.
Example
If you use typedef Words , Will make a difference :
struct Student
{
int no;
char name[12];
}stu1;//stu1 Is a global variable created
typedef struct Student2
{
int no;
char name[12];
}stu2;//stu2 It's a structural type , namely stu2 yes Student2 Another name for
You can directly access stu1.no
however stu2 You must first define stu2 s2;
then s2.no=10;
边栏推荐
- 网络协议模型
- P2802 go home
- Game push image / table /cv/nlp, multi-threaded start
- Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
- [QNX hypervisor 2.2 user manual]6.3.3 using shared memory (shmem) virtual devices
- Report on market depth analysis and future trend prediction of China's arsenic trioxide industry from 2022 to 2028
- [Jiudu OJ 08] simple search x
- Redistemplate common collection instructions opsforvalue (II)
- [JVM] [Chapter 17] [garbage collector]
- JS array list actual use summary
猜你喜欢

Is it difficult for an information system project manager?

Station B, Master Liu Er - dataset and data loading

Processes and threads

29io stream, byte output stream continue write line feed

Redis消息队列

Redis message queue

Vulhub vulnerability recurrence 72_ uWSGI

03. Login of development blog project

网站进行服务器迁移前应做好哪些准备?

The digital economy has broken through the waves. Is Ltd a Web3.0 website with independent rights and interests?
随机推荐
AUTOSAR从入门到精通番外篇(十)-嵌入式S19文件解析
MIT6.s081-2020 Lab2 System Calls
[SQL Server fast track] - authentication and establishment and management of user accounts
SequoiaDB湖仓一体分布式数据库2022.6月刊
PDK工藝庫安裝-CSMC
查询生产订单中某个(些)工作中心对应的标准文本码
Download, install and use NVM of node, and related use of node and NRM
Summary of deep learning tuning tricks
数字经济破浪而来 ,LTD是权益独立的Web3.0网站?
Anti shake and throttling are easy to understand
A master in the field of software architecture -- Reading Notes of the beauty of Architecture
Web Security (V) what is a session? Why do I need a session?
Yygh-11-timing statistics
清除浮动的方式
[detailed explanation of Huawei machine test] statistics of shooting competition results
B站刘二大人-线性回归及梯度下降
Sequoiadb Lake warehouse integrated distributed database, June 2022 issue
The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
大型网站如何选择比较好的云主机服务商?
What preparations should be made for website server migration?