title: How to get string value of token in flex and bison?
body: <p>I have this token in my .lex file:</p>
  
  <pre><code>[a-zA-Z0-9]+    { yylval = yytext; return ALPHANUM; }
  </code></pre>
  
  <p>and this code in my .y file:</p>
  
  <pre><code>Sentence: "Sphere(" ALPHANUM ")."
  {
  FILE* file = fopen("C:/test.txt", "a+");
  char st1[] = "polySphere -name ";
  strcat(st1, $2);
  strcat(st1, ";");
  fprintf(file,"%s", st1);
  fclose(file);
  }
  </code></pre>
  
  <p>I get this error when I try to compile:</p>
  
  <p>warning: passing argument 2 of ‘strcat’ makes pointer from integer without a cast</p>
  
  <p>So $2 is an int, how do I make it a string? </p>
  
  <p>For example: "Sphere(worldGlobe)." I want $2 to have the string value worldGlobe here.</p>
  
  <p>Thanks for any help</p>