Identifier restriction in global scope

Justin

In addition, identifiers defined outside a function may not begin with an underscore.

Why does this restriction apply only to variables outside of a function? Not sure what purpose this could serve.

Denis Itskovich

Related question: What are the rules about using an underscore in a C++ identifier?

Short answer: in order to avoid name collision with the standard libraries (e.g. STL, libc, etc.)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related