c - 如何理解void (*action)(struct softirq_action *)

标签 c

这是Linux内核中的软中断。如何理解void (*action)(struct softirq_action *);的定义?

struct softirq_action
{
    void (*action)(struct softirq_action *);
};

最佳答案

从最左边的标识符开始,然后逐步解决,记住以下规则:

T *a[N];   // a is an array of pointer to T
T (*a)[N]; // a is a pointer to an array of T
T *f();    // f is a function returning a pointer to T
T (*f)();  // f is a pointer to a function returning T

所以:

       action                                -- action
      *action                                -- is a pointer to
     (*action)(                       )      -- a function taking
     (*action)(                       )      --   unnamed parameter
     (*action)(                      *)      --   is a pointer to
     (*action)(struct softirq_action *)      --   struct softirq_action
void (*action)(struct softirq_action *);     -- and returning void

关于c - 如何理解void (*action)(struct softirq_action *),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51403674/

相关文章:

c - 正确传输客户端-服务器套接字连接中的文件

c++ - 什么是工具链和交叉编译器?

python - Python 中的 MCMC 实现

python - 进程间通信 Python

c - 如何在 C 中将 while 循环更改为 for 循环?

c - double 的推荐最小 epsilon 是多少?

c - GCC 发现错误包括

c - 理解书本上的 C 示例?

c - C语言实现linux下shell的输入输出

c - 数组中两个值的除法总是返回 0