how to print variable from value of other variable in c++
i’m just new in c++.
in php we can make/print a variable by the value of other variable.
like this.
$example = 'foo';
$foo = 'abc';
echo ${$example}; // the output will 'abc'
how can i solve this in c++?
Looking at it another way, it’s just indirection, which C++ uses extensively. An analogous example in C++ might be…
…or using a reference instead of a pointer…