当前位置:网站首页>为什么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文件中已经定义的结构体?
边栏推荐
- 应用实践 | 10 亿数据秒级关联,货拉拉基于 Apache Doris 的 OLAP 体系演进(附 PPT 下载)
- How to resolve kernel errors? Solution to kernel error of win11 system
- Variable autoencoders (vaes)
- 数据库学习笔记(SQL04)
- [C #] explain the difference between value type and reference type
- There are thousands of roads. Why did this innovative storage company choose this one?
- How many objects are created after new string ("hello")?
- leetcode 1689. Partitioning into minimum number of deci binary numbers
- SQL interview question: find the maximum number of consecutive login days
- Bayesian inference problem, MCMC and variational inference
猜你喜欢
![[C #] explain the difference between value type and reference type](/img/23/5bcbfc5f9cc6e8f4d647acf9219b08.png)
[C #] explain the difference between value type and reference type

在arm版本rk3399中搭建halo博客

i人事HR系统上架企业微信ISV,增强企微在服务连锁零售等行业深度应用

math_证明常用等价无穷小&案例&代换

SQL Server2019 新建 SQL Server身份验证用户名 并登录

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

Hands on Teaching of servlet use (1)

Build halo blog in arm version rk3399

Win11底部状态栏如何换成黑色?Win11底部状态栏换黑色的方法

Graduation project - Design and development of restaurant management game based on unity (with source code, opening report, thesis, defense PPT, demonstration video and database)
随机推荐
Hands on Teaching of servlet use (1)
基于趋势和季节性的时间序列预测
福建的朋友们,你们的养老保险上云啦!
PY SQL可以获取到表结构吗?
Markdown绘图mermaid实用教程
matlab 二维或三维三角剖分
Show the actual work case of creating intermediate data table with SQL
小白创业做电商,选对商城系统很重要!
Shell unknown rollup 1
Anonymous function this pointing and variable promotion
Servlet的使用手把手教学(一)
在arm版本rk3399中搭建halo博客
秋招经验分享 | 银行笔面试该怎么准备
行业分析| 快对讲,楼宇对讲
展示用sql创建中间数据表的实际工作用例
I just bought the ADB MySQL service. Every time I do an operation, such as creating a table, this problem will pop up. What is the problem?
Some error prone points of C language pointer
C语言局部变量与全局变量重名时的优先级问题(当局部变量和全局变量同时存在的时候,优先引用局部变量,而不去引用全局变量)
大火的虚拟人在哪些产业开始发力?
Analysys analytics' 2022 China Banking privacy computing platform supplier strength matrix analysis' research activity was officially launched