Creating local variables in a program?
Hello,
I want to make a program which reads a file to make multiple automated tasks.
This file is used to CREATE local variables in a program (like the "INT var =" in C, the "set VAR=" in DOS BATCH, the "VAR=" in SH, etc.). This means the variables name can vary.
For example (commentary character is #) :
Code:
################################################
############## PRINCIPAL SETTINGS ##############
################################################
FILEKEY = keylist.cfg
USER_0 = Lincoln
USER_1 = Kennedy
NUMBER_X = 82
NUMBER_Y = 139
NUMBER_Z = 226
INTERVAL = 927
[...]
My question is : How can I do this? I mean, how can I allocate memory to create local variables used in the program for various tasks?
If possible, I would like to not use the shell environment i.e. no calls of getenv() or system().
Also, would it be possible that the names of the variables in the program would be the same that in the file?
Thank you!
Sincerely,
fl0at