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
質問は似ていますが、投稿する前に関連するトピックを調べましたが、私の質問は具体的で、他の投稿から回答を推論することはできませんでした。 –