【发布时间】:2016-08-05 07:03:35
【问题描述】:
这个问题与C有关。关于双下划线变量的话题已经有很多问题了,例如,
What are the rules about using an underscore in a C++ identifier?
Why do people use __(double underscore) so much in C++
Meaning of double underscore in the beginning
据我所知,__myvar 保留供编译器使用。但是,我不确定在哪里可以找到这些变量的确切含义,以及如何使用它们。
例如,我正在研究这段代码:
#define fatalError(...) { char str[1000]; sprintf(str, __VA_ARGS__); printf( "%s (%s in %s, line %d)\n", str, __func__, __FILE__, __LINE__); exit(EXIT_FAILURE); }
例如,尚不清楚__VA_ARGS__ 指的是什么。由于它是编译器保留的,而且我使用的是 gcc,我应该在 gcc 文档中搜索 __VA_ARGS__ 吗?
【问题讨论】:
-
你可以随时用谷歌搜索它,就像任何变量一样(包括那些没有双下划线的变量)
标签: c reserved-words