c - 定义类型的顺序

标签 c types coding-style

将变量定义为staticlong/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/

相关文章:

c - 在**可移植 C** 中,如何启动将命令的标准输入连接到启动程序的标准输出的命令?

c - 下一个 C 标准的想法应该去哪里?

C 128 位 double 型

Python 函数参数 : tuple/list

c - 如何在 Linux 上用 GCC 编译 C 和 Gtk+?

C# 哪个是精度 3 的最佳数据类型?

mysql - 经纬度数据类型和存储格式

c# - 基类可以包含对其子类之一的引用吗?

java - 使用私有(private)静态方法

c - realloc 分配的内存比请求的多