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

Answer

The rules (which did not change in C++11):

  • Reserved in any scope, including for use as implementation macros:
    • identifiers beginning with an underscore and an uppercase letter
    • identifiers containing adjacent underscores (or "double underscore")
  • Reserved in the global namespaces:
    • identifiers beginning with an underscore
  • Also, everything in the std namespace is reserved. (You are allowed to add template specializations, though.)

From the 2003 C++ Standard:

All c++ Questions

Ask your interview questions on c

Write Your comment or Questions if you want the answers on c from c Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---