Hi,
In many codes and projects, I find variable names, structure definition, headerfile names starting with _ (underscore sign). Is that supposed to mean anything? Are they treated in some different manner?
Edesign
Hi,
In many codes and projects, I find variable names, structure definition, headerfile names starting with _ (underscore sign). Is that supposed to mean anything? Are they treated in some different manner?
Edesign
I believe names with a '_' preceeding them are reserved for compiler/implementation specific names.
That means, unless you're building a compiler or something, you're technically not supposed to do that.
Variable names can start with an underscore. There's no problem with that. Heres a simple example.
Code:#include<stdio.h> int main(void) { int _it; scanf("%d",&_it); printf("%d",_it); }
HOPE YOU UNDERSTAND.......
By associating with wise people you will become wise yourself
It's fine to celebrate success but it is more important to heed the lessons of failure
We've got to put a lot of money into changing behavior
PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
IDE- Microsoft Visual Studio 2008 Express Edition
In some cases. But it is not always true.
Compilers are known to accept incorrect coding constructs.
The C standard Section 7.1.3 "Reserved identifiers" has this to say on the subject.
(other categories of reserved identifiers not related to this topic not quoted).Each header declares or defines all identifiers listed in its associated subclause, and optionally declares or defines identifiers listed in its associated future library directions subclause and identifiers which are always reserved either for any use or for use as file scope identifiers.
— All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.
— All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.