Please explain this | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 2

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.

1st May 2021, 1:40 PM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar
3 Respuestas
+ 3
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.
1st May 2021, 1:49 PM
Arsenic - avatar
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.
5th May 2021, 5:19 AM
Vetrivel Subramani
Vetrivel Subramani - avatar
- 1
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 !
5th May 2021, 5:40 AM
Giriraj Yalpalwar
Giriraj Yalpalwar - avatar