Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
XCB ソースをブラウズしていると、この奇妙な構造体メンバーが見つかりました。
void (*return_socket)(void *closure);
どういう意味ですか?これを書く別の方法は何ですか?
それが関数ポインタです。as パラメータを返しvoidたり受け取ったりする関数を指します。void *
void
void *
たとえば、次のように使用できます。
void myFunction(void *closure) { printf("myFunction called with closure=%p", closure); } void (*return_socket)(void *closure) = myFunction;