I am trying to understand when a developer needs to define a C variable with preceding ‘_’. What is the reason for it?
For example:
uint32_t __xyz_ = 0;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Maybe this helps, from C99, 7.1.3 (“Reserved Identifiers”):
Moral: For ordinary user code, it’s probably best not to start identifiers with an underscore.
(On a related note, I think you should also stay clear from naming types with a trailing
_t, which is reserved for standard types.)