What is (double (^)(int))foofoo

你说的曾经没有我的故事 提交于 2019-12-19 17:48:33

问题


There is an example on cdecl that goes (double (^)(int))foofoo means cast foofoo into block (int) returning double.

What does it mean to cast foofoo into a "block" of int? What does the symbol ^ exactly mean in this context. Usually it is bitwise XOR.


回答1:


It's a GCC extension made by Apple, and implemented also in Clang. Blocks are small unnamed functions and that syntax is the type of a block. See Block Language Spec.



来源:https://stackoverflow.com/questions/3551999/what-is-double-intfoofoo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!