As has been mentioned, you are looking for reflection in C++. It doesn’t have that, and this answer explains why.
More Related Contents:
- Why uninitialized variable print a strange negative value? [duplicate]
- C++ while loop resetting variables?
- why this unexpected variable change happens? [closed]
- How do I store a value for later use?
- Is it better in C++ to pass by value or pass by constant reference?
- Is it possible to print a variable’s type in standard C++?
- Most efficient way to compare a variable to multiple values?
- What is the difference between an int and a long in C++?
- Why can’t variable names start with numbers?
- Variable initialization in C++
- const vs constexpr on variables
- dollar sign in variable name?
- Difference between static, auto, global and local variable in the context of c and c++
- When do function-level static variables get allocated/initialized?
- What happens to uninitialized variables? C++
- How do I get the type of a variable?
- Where do I find the definition of size_t?
- Do class functions/variables have to be declared before being used?
- C++ int with preceding 0 changes entire value
- Defining a variable in the condition part of an if-statement?
- How to generate random variable names in C++ using macros?
- Why can’t I do polymorphism with normal variables?
- c++ warning: address of local variable
- C++ Global variable declaration
- converting a variable name to a string in C++
- is it possible to make function that will accept multiple data types for given argument?
- generic way to print out variable name in c++
- Static global variables in C++
- Is the comma in a variable list a sequence point?
- Literal initialization for const references