如何在data.h和data.cpp下声明和定义,使得能在meun.cpp中直接引用head?
你想在哪个程序调用,就在哪个程序定义extern struct name *head;
同时你在定义结构体的那个程序中定义struct name *head;
extern是外部变量的声明,所以是在哪个使用程序中声明extern