这是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/