Qiao Jian wrote on 17/04/05 :
Thanks all the kind guys above. I think I have an idea of the meaning
of such directives with .h file
Just keep in mind that identifiers starting with '_' followed by an
uppercase belong to the implementatation namespace. While technically
possible, using them in the user namespace invokes un undefined
behaviour.
If a header from your implementation of C has '_RANDOM_H', it's just
fine. But if it is one of your own, I suggest 'RANDOM_H' or better
'H_RANDOM' to prevent from another namespace invasion (Identifiers
beginning with 'E' belong to the implementation...).
I personally use the folowing pattern:
H_<initials/company>_<file name>_<date><time>
date in YYYYMMDD format and time in HHMMSS format
It provides a better protection against doublons.
For example :
H_ED_RANDOM_20080416123300
that is used :
#ifndef H_ED_RANDOM_20080416123300
#define H_ED_RANDOM_20080416123300
/* ... */
#endif /* guard */
Of course, this is automated. (UltraEdit can do that, and I have
written a separated utility too.)
--
Emmanuel
The C-FAQ:
http://www.eskimo.com/~scs/C-faq/faq.html
The C-library:
http://www.dinkumware.com/refxc.html
"C is a sharp tool"