//文件A.c//非静态函数,全局变量
struct_type a ;
void func()
{
int b = 10;
func_ptr(b, &a);
}
//文件B.c// static func,global func ptr
void *func_ptr(int, *struct_type);
static void static_func(int val, struct_type *data)
{
//defn
func_ptr = &static_func;
}
接收到的分段错误
C中的静态函数是范围仅限于其目标文件的函数。