当前位置:网站首页>typedef defines the structure array type
typedef defines the structure array type
2022-08-11 03:27:00 【family20102010】
PS: Typedef defines only an alias (or label) of type XX, which cannot be used directly as a variable, but can only be used to define a variable.
Example 1:
typedef struct st{char id;int num;char name[10];}DATA[10];//The DATA here is not an array, it only means an array type, which cannot be used in the programUse DATA[i] directlyDATA tmp;//It is equivalent to defining an array tmp[10], element type = structure st, which can be used directly in the programtmp[i]Example 2:
typedef struct {word Head;word Length;byte PDUType;byte SRC_ID[10];byte DST_ID[10];byte PDUdata[200];}TReqFunReg, * PReqFunReg;Typedef TreqFunReg reg[100];//Note: The reg here only represents an array type, not an array. You cannot use reg[i] directly in the program. The correct usage is to use regDefine a variable, this variable is an array with 100 elements, and the element type is the structure TreqFunReg.TreqFunReg reg1[100];//This is the definition of a structure array (without Typedef modification), you can use reg1[i] directly in the programreg aaa; //equivalent to TreqFunReg aaa[100]; aaa[i] can be used directly in the program边栏推荐
- Typescript学习笔记 | 字节青训营笔记
- 获取链表长度
- 广州纸质发票再见!开住宿费电子发票即将全面取代酒店餐饮加油站发票
- The "top pillar" slides, and new growth is extremely difficult to shoulder the heavy responsibility. Is Ali "squatting" to jump higher?
- oracle的基数会影响到查询速度吗?
- C language recv() function, recvfrom() function, recvmsg() function
- "Life Is Like First Seen" is ill-fated, full of characters, and the contrast of Zhu Yawen's characters is too surprising
- (Nips-2015)空间变换器网络
- UNI-APP_iphone苹果手机底部安全区域
- 【LeetCode】Day112-重复的DNA序列
猜你喜欢

大马驮2石粮食,中马驮1石粮食,两头小马驮一石粮食,要用100匹马,驮100石粮食,如何分配?

云平台下ESB产品开发步骤说明

Realization of vending machine function based on FPGA state machine

C语言之自定义类型------结构体

Unity2D animation (1) introduction to Unity scheme - animation system composition and the function of use

你不知道的 console.log 替代品

Qnet弱网测试工具操作指南

A large horse carries 2 stone of grain, a middle horse carries 1 stone of grain, and two ponies carry one stone of grain. It takes 100 horses to carry 100 stone of grain. How to distribute it?

Idea (优选)cherry-pick操作

二叉树相关代码题【较全】C语言
随机推荐
AI + medical: for medical image recognition using neural network analysis
Detailed explanation of VIT source code
电力机柜数据监测RTU
【愚公系列】2022年08月 Go教学课程 035-接口和继承和转换与空接口
Is Redis old?Performance comparison between Redis and Dragonfly
大马驮2石粮食,中马驮1石粮食,两头小马驮一石粮食,要用100匹马,驮100石粮食,如何分配?
[Pdf generated automatically bookmarks]
Meaning of df and df -lh
Typescript学习笔记 | 字节青训营笔记
什么是三方支付?
Goodbye Chongqing paper invoices!The issuance of electronic invoices for accommodation expenses will soon completely replace the invoices of hotels, catering and gas stations
【Pdf自动生成书签】
MongoDB 基础了解(二)
Kubernetes集群搭建Zabbix监控平台
DOM-DOM tree, a DOM tree has three types of nodes
EasyCVR接入海康大华设备选择其它集群服务器时,通道ServerID错误该如何解决?
The problem that Merge will be lost again after code Revert has been solved
The impact of programmatic trading and subjective trading on the profit curve!
广州纸质发票再见!开住宿费电子发票即将全面取代酒店餐饮加油站发票
Homework 8.10 TFTP protocol download function