typedef int (&rifii) (int, int)
将用于什么?C++语法/语义问题:引用函数和typedef关键字
这个“声明”之前的typedef是做什么的? 我想认为这是
typedef (int (&rifii) (int, int)) [new name]
但[新名称]是不存在一样,如果你对下面的语法做
typedef int INTEGER;
类似的问题:
typedef void (*PF)();
PF edit_ops[ ] = { &cut, &paste, ©, &search };
PF file_ops[ ] = { &open, &append, & close, &write };
PF* button2 = edit_ops;
PF* button3 = file_ops;
button2[2]();
什么typedef是否允许?难道使得它,这样你就不必键入:
void (*PF)();
(void (*PF)()) edit_ops[ ] = { &cut, &paste, ©, &search };
(void (*PF)()) file_ops[ ] = { &open, &append, & close, &write };
(void (*PF)())* button2 = edit_ops;
(void (*PF)())* button3 = file_ops;
如果是发生了什么的第二部分([你想要什么])中的typedef像:
typedef [what you have -- (FP)] [what you want]
澄清此事不胜感激。
http://stackoverflow.com/questions/1591361/understanding-typedefs-for-function-pointers-in-c-examples -hints-and-tips-plea – vines
这个问题是类似的,我在发帖之前仔细查看了相关主题,但是我的问题是特定的,我无法从其他帖子推断出答案。 –