类似这样结构的结构体该如何定义?
c++吧
全部回复
仅看楼主
level 11
gameloftyou 楼主
typedef struct
{
double x;
double y;
fdata *next;
}fdata;
本来想弄个链表的,没想到上来写个结构体就报错:
E:\C++\sheyu\sheyu2.cpp(13) : error C2501: 'fdata' : missing storage-class or type specifiers
E:\C++\sheyu\sheyu2.cpp(13) : error C2501: 'next' : missing storage-class or type specifiers
这些错误都是什么意思啊,该如何定义一个
正确的

求教...
2012年04月08日 08点04分 1
level 8
typedef struct stru_name //YOU_MISSED_THIS
{
double x;
double y;
fdata *next;
}fdata;
2012年04月08日 08点04分 2
level 8
[拍砖]
typedef struct node
{
int data;
node *next;
}NODE;
2012年04月08日 08点04分 3
level 11
gameloftyou 楼主
恩,可以了非常感谢[Love]
我想可能是我在结构体里引用了fdata,所以外边struct关键字后边的fdata不能省略,不然的话,struct名字应该是可以省略的。
2012年04月08日 08点04分 4
level 11
gameloftyou 楼主
恩,我写的不规范,[傻笑]
2012年04月08日 08点04分 5
1