【发布时间】:2014-02-16 09:25:25
【问题描述】:
我正在尝试在 Objective C 中创建一个 LinkedList。
在 .h 文件中,我尝试使用代码创建节点:
@interface AALinkedList : NSObject
{
typedef struct Node
{
int data;
struct Node *next;
} Node;
}
这给了我一个错误说Type name does not allow storage class to be specified
这是什么意思?以及如何解决?
【问题讨论】:
-
您不能在 Objective-C 类的数据部分定义新类型。
storage class是关于typedef,因为它是一个存储类,就像static或auto一样。
标签: objective-c c linked-list