简体   繁体   English

C中的struct中使用的函数指针

[英]function pointer used in struct in C

Could anyone explain the following syntax of code for structures in C ? 谁能解释C语言中结构的以下语法?

struct { 
  Fn *pmq;
}
service_MQ[] = 
{
   NULL
   #define BUILd_SVC_MQ(name , func) , (Fn*) Func
   #include<mqsvctable.h>
};
  • There is a structure with only member as a pointer (possibly to a function) 有一个只有成员作为指针的结构(可能是函数)
  • There is an x-header file mqsvctable.h containing list of functions under BUILd_SVC_MQ macro. x头文件mqsvctable.h包含BUILd_SVC_MQ宏下的功能列表。 Something like 就像是
BUILd_SVC_MQ("clear", clear_screen)
BUILd_SVC_MQ("delete", delete_something)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM