I’m implementing some code generators, i would like to know if there’s any way in C, if a variable has already been declared ?
I was trying to find something using the preprocessor but without any success…
thanks.
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.
C is strictly static, you can’t “lookup” if a variable has already been declared. If you are creating a code generator, why not read lines of code and see what’s been declared?