Order of defining types

2019-01-20 07:38发布

Is there any preference/convention/rule on order for defining a variable as static and long/double or other types?

e.g. is

static double a;

same as

double static a;

is it any different for functions? above, a is variable.

1条回答
劳资没心,怎么记你
2楼-- · 2019-01-20 08:07

They are equivalent but static at the beginning is preferred.

(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"

查看更多
登录 后发表回答