Please explain this | Sololearn: Learn to code for FREE!


Please explain this

I have read this statement in c++ book , if it is correct then why my code is running ! The identifiers we define in our own programs may not contain two consecutive underscores, nor can an identifier begin with an underscore followed immediately by an uppercase letter. In addition, identifiers defined outside a function may not begin with an underscore.

5/1/2021 1:40:42 PM


3 Answers

New Answer


This is because these types of identifiers are reserved for implementation to use. In this case, you are lucky to not get any problem when using these, but results might differ from compiler to compiler, that's why it is recommended to not use such identifier names in your program as they might conflict with the ones used by your implementation.


Identifiers can begin only with _ or alphabet, can be either uppercase or lowercase letters . It can contain numbers as part of identifier. We prefer lowercase letter to identifiers is to easily diffrentiate it between identifiers, Class, Macro.


Vetrivel Subramani We know this , I'm saying that above sentence is correct or it depends on compiler-to-compiler , OS etc. or it is wrong !