将变量定义为static
和long/double
或其他类型是否有任何偏好/约定/规则?
例如是
static double a;
和
一样double static a;
函数有什么不同吗?上面,a是变量。
最佳答案
它们是等价的,但首选以 static
开头。
(C99, 6.11.5p1) "The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature"
关于c - 定义类型的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17293232/