gpt4 book ai didi

c - 内联函数 C 的函数指针

转载 作者:太空狗 更新时间:2023-10-29 16:12:39 25 4
gpt4 key购买 nike

inline void myfunction(){
//something here
}

void main(){
void (*p)(void);
p = myfunction;
p();
}

不同的编译器可以为此生成什么样的机器码,在什么情况下?

最佳答案

由于您的编译器需要函数的地址,因此它将生成目标代码的独立副本。

关于c - 内联函数 C 的函数指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21705468/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com