title: CPP how to escape a quotation mark
body: <p>I'm in the process of making code from 1991 work on Ubuntu 19.</p>
  
  <p>I've got this file I need to run through CPP where I am forced to use the -traditional option.</p>
  
  <pre><code>#define ITEM_WEAPON 5
  #define ITEM_FIREWEAPON 6
  Trade types = "+ITEM_WEAPON+ITEM_FIREWEAPON+"
  </code></pre>
  
  <p>I want the line to become</p>
  
  <pre><code>Trade types = "+5+6+"
  </code></pre>
  
  <p>This worked just fine in 1991-1997 ;-) It seems cpp for obvious reasons no longer parse between quotation marks.</p>
  
  <p>I've tried to escape the quotes using the backslash character e.g. </p>
  
  <pre><code>Trade types = \""+ITEM_WEAPON+ITEM_FIREWEAPON+\""
  </code></pre>
  
  <p>But still haven't found a good solution. </p>
  
  <p>For clarity this is not a C program, instead we simply used cpp to expand various macros into a structured text file which was later run through a parser.</p>
  
  <p>The closest I have come (with -traditional flag) to something that almost works is this:</p>
  
  <pre><code>#define WI 1
  #define WJ 2
  
  #define T(a,b) Trade types = "+a+b+"
  T(1,2)
  T(WI,WJ)
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>Trade types = "+1+2+"
  Trade types = "+WI+WJ+"
  </code></pre>
  
  <p>So the pre-processor does substitute the arguments between the quotes but does not expand the parametized macro.</p>