当前位置:网站首页>为什么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文件中已经定义的结构体?
边栏推荐
- 令人惊艳的NanoPC-T4(RK3399)作为工作站的初始配置和相关应用
- 腾讯汤道生:面向数实融合新世界,开发者是最重要的“建筑师”
- 直播app系统源码,动态遇到视频时开始自动播放
- 智能计算系统2 bangc算子开发的demo (CPU和MLU270的异构编程流程)
- About Statistical Distributions
- Bayesian inference problem, MCMC and variational inference
- Opengauss kernel: analysis of SQL parsing process
- 请问下flinkcdc用flinksql提交的话只能一个表提交一个任务吗?那有几千张表的时候还能这么
- 180.1. Log in continuously for n days (database)
- mysql全解 Ubuntu/win10
猜你喜欢

易观分析《2022年中国银行业隐私计算平台供应商实力矩阵分析》研究活动 正式启动

sql面试题:求连续最大登录天数

sql计算每日新增用户、及留存率指标

Win11如何给系统盘瘦身?Win11系统盘瘦身方法

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

How many objects are created after new string ("hello")?

大火的虚拟人在哪些产业开始发力?

Mindspire series one loading image classification data set

月环比sql实现

数字经济专家高泽龙:映客更名映宇宙,元宇宙会成为映客下一个增长引擎吗?
随机推荐
List adding timer (positive and countdown)
Brief introduction to mongodb working principle of mongodb series
直播app系统源码,动态遇到视频时开始自动播放
Figure introduction to neural networks (GNN, GCN)
Double contextual relationship network for polyp segmentation
Bayesian inference problem, MCMC and variational inference
变分自编码器 (Variational Autoencoders, VAEs)
Live app system source code, automatically playing when encountering video dynamically
I. The HR system is put on the enterprise wechat ISV to enhance the in-depth application of enterprise wechat in service chain retail and other industries
i人事HR系统上架企业微信ISV,增强企微在服务连锁零售等行业深度应用
Bayesian Reference problem, mCMC and variational reference
Openharmony - detailed source code of Kernel Object Events
In which industries did the fire virtual human start to make efforts?
微博评论的高性能高可用计算架构方案
PCL 计算平面三角形外接圆的圆心和半径
Opengauss kernel: analysis of SQL parsing process
Sound network releases lingfalcon Internet of things cloud platform, which can build sample scenarios in one hour
图神经网络入门 (GNN, GCN)
Chunfeng power and Huawei work together to build a smart Park benchmark, and the future factory innovation will reach a new level
判断字符串是否为空