gpt4 book ai didi

C++:标识符规则不起作用

转载 作者:行者123 更新时间:2023-11-27 22:58:20 25 4
gpt4 key购买 nike

<分区>

根据 Stanley Lipp 的 C++ Primer 第 5 版:

The standard also reserves a set of names for use in the standard library. The identifiers we define in our own programs may not contain two consecutive underscores, nor can an identifier begin with an underscore followed immediately by an uppercase letter. In addition, identifiers defined outside a function may not begin with an underscore.

以下所有内容均已编译:

g++ -std=c++11 -o test test.cc

int _I=40;
int main() {
int __=10;
int _B=20;
}

我认为它不应该编译..

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