-2

Possible Duplicate:
What is forward reference in C?

I read this question somewhere

"What is forward reference with respect to pointers in C, and what are its advantages"

The accepted answer mentioned in here : What is forward reference in C? doesn't give a proper explanation? Can anyone explain what exactly it means? and does it have any advantages?

4

1 回答 1

2

前向引用 wrt 指针是我们使用的术语,当

声明了一个指针,编译器为指针保留了内存,但未定义指针指向的 DataItem。

从以前的答案::

struct MyStruct *ptr; // this is a forward reference cuz pointer ptr is declared
                      // but the structure it points to is itself not defined till now.

struct MyStruct // Now the structure is declared
{
       // some data members
};

优点::优点

于 2013-02-02T07:26:40.240 回答