C++ Command Line: Output program variable value <p>I am writing a drop-down console for my app. Suppose I want to output the value of variable <code>myvar</code> by using the following command:</p> <pre><code>]/get myvar </code></pre> <p>Is there a better way than to create a map so that the output is </p> <pre><code>return mymap[argv[0]]; ? </code></pre> <p>In other words, can I associate the input char array "myvar" to the variable named myvar without doing it manually for all the variables in the program.</p>