Is _ (single underscore) a valid C++ variable name?
问题 With gcc 4.7.2 this compiles just fine for me: int main() { int _ = 1; return 0; } Can I expect this to compile in general? I've read the answers about underscores as prefixes. But what if the underscore isn't prefixing anything? 回答1: Yes, from The C++ Programming Language, 4th Edition: A name (identifier) consists of a sequence of letters and digits. The first character must be a letter. The underscore character, _, is considered a letter. 回答2: According to Stroustrup (3rd edition, section 4.9