相关疑难解决方法(0)

我可以获得最佳性能制作静态变量吗?

为什么有些人这样做:

char baa(int x) {
    static char foo[] = " .. ";
    return foo[x ..];
}
Run Code Online (Sandbox Code Playgroud)

代替:

char baa(int x) {
    char foo[] = " .. ";
    return foo[x ..];
}
Run Code Online (Sandbox Code Playgroud)

在linux源代码应用程序上看起来很常见.有性能差异?如果有,有人可以解释原因吗?提前致谢.

c static static-variables

13
推荐指数
2
解决办法
5834
查看次数

标签 统计

c ×1

static ×1

static-variables ×1