gpt4 book ai didi

c - C中常量的奇怪声明

转载 作者:太空狗 更新时间:2023-10-29 15:45:04 28 4
gpt4 key购买 nike

我真的不明白这里有什么区别

const int a = 1;
int const a = 1;

我知道常量是什么,但上面的例子让我很困惑。

最佳答案

没有区别。两者相同。

n1570 草案:6.7.2 类型说明符:

Type specifiers are void, char, short, int, long, float, double, signed, unsigned, _Bool, _Complex, <struct-or-union-specifier>, <enum-specifier>, and <typedef-name>.

At least one type specifier shall be given in the declaration specifiers in each declaration, and in the specifier-qualifier list in each struct declaration and type name. Each list of type specifiers shall be one of the following multisets (delimited by commas, when there is more than one multiset per item); the type specifiers may occur in any order1, possibly intermixed with the other declaration specifiers.


1.重点是我的

关于c - C中常量的奇怪声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20401911/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com