简体   繁体   English

这个演员做什么?

[英]What does this cast do?

I was taking a look at some code for a microcontroller when I came across this cast: 当我遇到这个演员时,我正在看一些微控制器的代码:
(void (*) (void))ROM_FPUTABLE[8]
I was wondering what it actually does. 我想知道它的实际作用。 Any ideas? 有任何想法吗?

void (*) (void) specifies a pointer to a function, which returns nothing, and takes no arguments. void (*) (void)指定一个指向函数的指针,该函数不返回任何内容,并且不接受任何参数。

Therefore (void (*) (void)) casts something to a pointer to a function, which returns nothing, and takes no arguments. 因此(void (*) (void))将某些内容强制转换为指向函数的指针,该函数不返回任何内容,并且不接受任何参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM