ç的typedef

编程入门 行业动态 更新时间:2024-10-24 08:20:02
本文介绍了ç的typedef - 不完全类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

所以,出了蓝色,编译器决定在脸上吐这一点:外地客户有不完全的类型。

So, out of the blue, the compiler decides to spit this in face: "field customer has incomplete type".

下面是code的相关片段:

Here's the relevant snippets of code:

#include <stdlib.h> #include <string.h> #include "customer.h" struct CustomerStruct; typedef struct CustomerStruct { char id[8]; char name[30]; char surname[30]; char address[100]; } Customer ; /* Functions that deal with this struct here */

customer.h

有关customer.h头文件

customer.h

A header file for customer.h

#include <stdlib.h> #include <string.h> #ifndef CUSTOMER_H #define CUSTOMER_H typedef struct CustomerStruct Customer; /* Function prototypes here */ #endif

这是我的问题是:

#include <stdlib.h> #include <string.h> #include "customer.h" #include "customer_list.h" #include "..\utils\utils.h" struct CustomerNodeStruct; typedef struct CustomerNodeStruct { Customer customer; /* Error Here*/ struct CustomerNodeStruct *next; }CustomerNode; struct CustomerListStruct; typedef struct CustomerListStruct { CustomerNode *first; CustomerNode *last; }CustomerList; /* Functions that deal with the CustomerList struct here */

这源文件的头文件,customer_list.h,但我不认为它相关的。

This source file has a header file, customer_list.h ,but I don't think its relevant.

在customer_list.c,在与注释的行 / *错误在这里* / ,编译器会抱怨外地客户有不完整的类型。

In customer_list.c, at the line with the comment /* Error Here */, the compiler complains about field customer has incomplete type.

我一直在谷歌上搜索这个问题了一整天,现在即时通讯。

I've been googling this problem all day, and now im at the point of pulling out my eyeballs and blending them with strawberries.

这是什么错误的根源?

在此先感谢:)

[P.S。如果我忘了提东西,让我知道。其对我来说是紧张的一天,因为你可能会告诉]

[P.S. if I forgot to mention something, let me know. Its been a stressful day for me, as you might tell ]

推荐答案

移动结构声明的标题:

customer.h typedef struct CustomerStruct { ... }

更多推荐

ç的typedef

本文发布于:2023-11-27 09:00:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637399.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:typedef

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!