cvariablesdynamic-variables

Dynamic variable declaration in C


I'm a ruby developer and its been long time since I've coded in C. I want to use a datatype in C which behaves like a symbol.

Is this possible?


Solution

  • Unlike in interpreted languages, C does not have a dictionary of variable names at runtime. There exist no variable names at runtime at all. Hence unfortunately it is impossible to do what you want in C.