- 主题:这个static有什么作用?
static inline void encode_base64(char dest[static 4], const uint8_t src[stat
ic 3]) {...}
这个函数参数中的 static 4 感觉好奇怪,印象中没有见过这么用的,这里的static啥
作用?
--
修改:gameplayer FROM 222.128.5.*
FROM 222.128.5.*
不是开头那个static,是函数参数中的 char dest[static 4],这里的static
【 在 fanci 的大作中提到: 】
: 常见,表明这个函数只在这个.c文件里定义和使用。
: 如果别的.c文件里有同名函数,则互不干扰。
--
修改:gameplayer FROM 222.128.5.*
FROM 222.128.5.*
3Q! 原来就是个提示,告诉调用者参数的要求,不符合时编译器也会有警告
It tells the user of the function that they must provide an array of at
least 5 elements (and if they do not, they will invoke undefined behaviour).
It tells the optimizer that it may assume a non-null pointer to an array
of at least 5 elements and it may optimize accordingly.
【 在 haha103 的大作中提到: 】
: 没见过 :(
: 搜了一下
: A declaration of a parameter as ''array of type'' shall be adjusted to
: ...................
--
修改:gameplayer FROM 222.128.5.*
FROM 222.128.5.*