Checking for the existence of a variable in C
I've looked for an answer to this, but I can't find a solution.
I have some code that I'm adding a function to. Basically, I'm adding the ability to change some default values, by reading in a file line by line to re-define the default values that the code earlier defined. So when my function reads in "A = 1.0" I want it first to check if A is defined, and if it isn't, return a warning, but not crash or stop.
(More detail: this code is about 20000 lines long, and I can't re-write to make #define statements for every variable. Nor do I wish to print out the hundreds of variables for the user to pick the one he/she wants to change. He/she should have an idea of the name of the variable "wave_period_meters" and if they get it wrong or misspell it, I want them to be able to try again, rather than have the code crash.)
I am new to this, so I hope this makes sense. Thanks! Jim