I'm expecting something like below.
int genVar001, genVar002, genVar003;
int adrgenVar, status;
char strvariable[] = "genVar001";
status = somefunction(&strvariable, adrgenVar);
Where 'adrgenVar' will have the address of genVar001.! If the variable is not available the status should return error.
Why it is required: for manipulation of the values in the runtime (via keyboard or files).
Lookup table will not help me because it would increase the job; maintain the table if anything new is added.
Edit: I'm working with PLCs, Here is the library which will allow me to do so. Function: PV_xgetadr.