c++ - 在C/C++中将变量名定义为__00000001有什么好处

标签 c++ c variable-names

将变量名称定义为 __00000001、__00000002 等有什么优点吗?

示例:

int __00000001, __00000002 = 0;
for (__00000001 = 0; __00000001 < 10; __00000001++) {
    __00000002 = __00000002 + __00000001;
}
...

更新:这是我几年前的一门编程课上提到的,我记得教授说使用它有一些优点。然而,我记不起更多的信息了。也许我错了。

最佳答案

这些特定的变量名称不可用于用户程序:

All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. (C11, section 7.1.3, paragraph 1)

所以这是一个很大的缺点。

关于c++ - 在C/C++中将变量名定义为__00000001有什么好处,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53074552/

相关文章:

jquery - 如何使用 jQuery 创建通用 id 引用

python - Python中的变量名可以以整数开头吗?

c++ - 在 C++ 中使用标准库函数名作为标识符是否有效?

c++ - 绕过SDL2中的 "int main(int argc, char** argv)"

c - 使 printf 中的某些文本显示为绿色和红色

c - 程序没有打印我需要打印的内容

c - 段错误 - GNU C

c++ - 如何强制 Windows 向所有应用程序发送 'LOW_MEMORY' 信号?

c++ - CUDA 6.0 链接错误 : undefined reference to `__cudaUnregisterFatBinary'

c# - 带有 Arduino 的 Alt-Tab 踏板