int main()
{
// forward declaration
struct myStruct_st *mS; // Note that this will expand as "struct struct myStruct_st *mS which does not make any sense to me"
return 0;
}
// definition of myStruct_s
typedef struct myStruct_s
{
int x;
int y;
} myStruct_st;
我明白myStruct_s是需要前向声明的结构。我的代码中似乎有编译错误。我想知道如何。有人知道吗?有谁知道为什么这个编译成功?
这只是一个方面的评论,但我通常把'typedef's和这样的_before_'main()'(当我没有将它们包含在头文件中时,就是这样)。 – JAB