How can I make variable in C with name specified in char table?
something like:
char name[];
gets(name[]);
int name[] = 0;
I hope you k
C, unlike scripting languages ala Python, or Ruby which you may be used to, is compiled not interpreted. At runtime, C does not have a look up table of variable names like the aforementioned scripting languages, this information is thrown away at compile time and thus, any name that is calculated at run-time cannot be turned into an address.
Ultimately, as you describe it this is impossible in compiled languages. However, we do have an alternative, found in Collections such as vectors and HashMaps which store naming information at run-time, allowing us to access it. Again, unfortunately, C does not have any native implementations of these, but there are some around.