title: Printing a string literal token in yacc using printf causes a segmentation fault
body: <p>I'm trying to print a string with a char pointer in Yacc but when I try it gives me a seg fault. The In the lex file it looks like:</p>
  
  <pre><code>\"([^"]|\\\")*\" {yylval.s = strdup(yytext); yycolumn += yyleng; return(STRINGnumber);}
  </code></pre>
  
  <p>And I receive the string literal looks like: </p>
  
  <pre><code>//Used to store the string literal
  char * s;
  //To store it I call
  strcpy(s, $1); //Where $1 is the string literal
  </code></pre>
  
  <p>Whenever I call</p>
  
  <pre><code>printf("%s", s);
  </code></pre>
  
  <p>It gives me a segmentation fault. Why does it do this and how can it be fixed? </p>