they comes from previous code, if i can say it so, but they will not be hard-coded, if i understand well what do you mean it
I'm still not entirely convinced from what you've said that you actually need to look up a variable by name, but you might.
There are lots of alternative ways to implement it, depending how clever a coder you are and how important it is to minimise code space, memory use, programming time, maintenance costs and so on.
I suggest there are two parts to the problem. First you have to have a list of names that are available to be selected. Second, you have to be able to do (something) to the named variable. You have said that you want to be able to display the value as a string, but you haven't said whether that's all you want.
The completely general solution would be to define an abstract class that provided the interface to let you do all the things you want to do to these named values, and define a map class which enabled you to store and look up an instance of that abstract class by name, and implement concrete classes for each data type that you needed to support. Then declare and populate the map with instances representing all the variables you want to be accessible. That part can be made more concise by using macros to populate the map, and using the #stringify operator within the macro to derive a string containing the symbolic name of each variable you want included in the map.
The amount of code involved would be small, probably 40 - 50 lines of code for the framework, and a couple of lines per named variable. An experienced coder could probably write and test it in half an hour or so. But hopefully you have got some idea now of the amount of complexity involved in solving this problem properly. I'd expect that to be quite a daunting project for a novice, and I would have thought in almost all cases it was not worth the bother.
A much easier solution would be to hard-code a function that accepted a variable name as an argument and just did a sequence of else if(strcmp ... calls to work out what the variable name is and do whatever-it-is to that variable. If the goal was to convert a value to a display string then inside the code block for each variable you could use a sprintf() call with the appropriate format string to print the value to the specified output buffer. If you wanted to do something else to these variables, you'd need to do a copy-and-paste to produce a whole new function that had similar logic to match the variable name, and did whatever other operation you wanted to support. If you wanted to be able to offer a list of variable names to select from, you would add a const array of strings and simply hard-code the names of the supported variables. It's not elegant, not very flexible, and not very maintainable, but avoids having to do anything clever.