title: Expand macros inside quoted string
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/798221/c-macros-to-create-strings">C Macros to create strings</a>  </p>
  </blockquote>
  
  
  
  <p>I have a function which accepts one argument of type <code>char*</code>, like <code>f("string");</code> <br>
  If the string argument is defined by-the-fly in the function call, how can macros be expanded within the string body?</p>
  
  <p>For example:</p>
  
  <pre><code>#define COLOR #00ff00
  f("abc COLOR");
  </code></pre>
  
  <p>would be equivalent to</p>
  
  <pre><code>f("abc #00ff00");
  </code></pre>
  
  <p>but instead the expansion is not performed, and the function receives literally <code>abc COLOR</code>.</p>
  
  <p>In particular, I need to expand the macro to exactly <code>\"#00ff00\"</code>, so that this quoted token is concatenated with the rest of the string argument passed to <code>f()</code>, quotes included; that is, the preprocessor has to finish his job and welcome the compiler transforming the code from <code>f("abc COLOR");</code> to <code>f("abc \"#00ff00\"");</code></p>