当前位置:网站首页>为什么C语言用使用其他文件的结构体变量时,声明结构体别名还不行,必须使用本名?(使用别名时不能加struct)
为什么C语言用使用其他文件的结构体变量时,声明结构体别名还不行,必须使用本名?(使用别名时不能加struct)
2022-06-28 19:17:00 【Dontla】
问题
如图,我在a文件使用b文件的结构体变量时,声明结构体时,还得使用结构体本名
kyai.h
kyai.c
demo_main.c
用别名就不行

原因
使用别名时不能加struct,不然就会报错
可以这样
demo_main.c
注意,创建结构体时,使用别名时也不能加struct,会报错
kyai.c

这样就没事
参考文章:如何在一个.c文件中声明另一个.c文件中已经定义的结构体?
边栏推荐
- Can only one task be submitted by one table if the flinkcdc is submitted by flinksql? When there are thousands of watches
- 数据基础设施升级窗口下,AI 新引擎的技术方法论
- Brief introduction to mongodb working principle of mongodb series
- Anonymous function this pointing and variable promotion
- Grafana draws the trend chart
- Building tin with point cloud
- There are thousands of roads. Why did this innovative storage company choose this one?
- 怎样去除DataFrame字段列名
- How to resolve kernel errors? Solution to kernel error of win11 system
- Build halo blog in arm version rk3399
猜你喜欢

使用点云构建不规则三角网TIN

应用实践 | 10 亿数据秒级关联,货拉拉基于 Apache Doris 的 OLAP 体系演进(附 PPT 下载)

Graduation project - Design and development of restaurant management game based on unity (with source code, opening report, thesis, defense PPT, demonstration video and database)

How to change the status bar at the bottom of win11 to black? How to change the status bar at the bottom of win11 to black

腾讯汤道生:面向数实融合新世界,开发者是最重要的“建筑师”

Bayesian inference problem, MCMC and variational inference

道路千万条,为什么这家创新存储公司会选这条?

shell读取Json文件的值

秋招经验分享 | 银行笔面试该怎么准备

月环比sql实现
随机推荐
How to resolve kernel errors? Solution to kernel error of win11 system
深度学习需要多强的数学基础?
NanoPC-T4(RK3399) game1 oled(I2C)显示时间天气温度
A few lines of code can realize complex excel import and export. This tool class is really powerful!
智能计算系统3 Plugin 集成开发的demo
Taishan Office Technology Lecture: word strange font height
About covariance and correlation
微博评论的高性能高可用计算架构方案
Figure introduction to neural networks (GNN, GCN)
Building tin with point cloud
math_ Proving common equivalent infinitesimal & Case & substitution
Render function parsing
How does the computer check whether the driver is normal
智能计算系统2 bangc算子开发的demo (CPU和MLU270的异构编程流程)
h5向日葵作业
怎样去除DataFrame字段列名
直播app系统源码,动态遇到视频时开始自动播放
Get the timestamp of 0:00 and 23:59 of the current date
Build halo blog in arm version rk3399
pd.cut 区间参数设定之前后区别