title: How to use Macro argument as string literal?
body: <p>I am trying to figure out how to write a macro that will pass both a string literal representation of a variable name along with the variable itself into a function.</p>
  
  <p>For example given the following function.</p>
  
  <pre><code>void do_something(string name, int val)
  {
     cout &lt;&lt; name &lt;&lt; ": " &lt;&lt; val &lt;&lt; endl;
  }
  </code></pre>
  
  <p>I would want to write a macro so I can do this:</p>
  
  <pre><code>int my_val = 5;
  CALL_DO_SOMETHING(my_val);
  </code></pre>
  
  <p>Which would print out: <code>my_val: 5</code></p>
  
  <p>I tried doing the following:</p>
  
  <pre><code>#define CALL_DO_SOMETHING(VAR) do_something("VAR", VAR);
  </code></pre>
  
  <p>However, as you might guess, the VAR inside the quotes doesn't get replaced, but is just passed as the string literal "VAR". So I would like to know if there is a way to have the macro argument get turned into a string literal itself.</p>