寻求复杂的C表达式的解释:(*(void(*)())sc)()

use*_*663 4 c syntax

这段代码是如何工作的?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

sc[] = bla bla bla a bunch of hex;

int main(void)
{  
   (*(void(*)()) sc)();
}
Run Code Online (Sandbox Code Playgroud)

(*(void(*)()) sc)();是我不确定的.

She*_*ley 6

Sc []是一个机器指令数组,每个字节用十六进制表示.

main中的行将sc解释为指向不带参数且返回void的函数的指针,并调用该函数.