Possible Duplicate:
What is forward reference in C?
我在某处读过这个问题
"What is forward reference with respect to pointers in C, and what are its advantages"
此处提到的已接受答案:What is forward reference in C? 没有给出适当的解释? 谁能解释一下它到底是什么意思?它有什么优点吗?
最佳答案
向前引用指针是我们使用的术语,当
声明了一个指针,编译器为该指针保留了内存,但未定义该指针所指向的 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
};
优点::Advantages
关于c - 关于指针的前向引用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14659601/