title: C String split and print the tokens.
body: <p>I am trying to split the string and print the tokens. </p>
  
  <pre><code>int main()
  {
      char line[255] = "182930101223, KLA1513";
      char val1[16];
      char val2[7];
  
      strcpy(val1, strtok(line, ","));
      strcpy(val2, strtok(NULL, ","));
  
      printf("%s|%s\n", val1, val2);
  
      return 0;
  }
  </code></pre>
  
  <p>When I print I get </p>
  
  <pre><code>  3| KLA1513
  </code></pre>
  
  <p>instead of </p>
  
  <p>182930101223| KLA1513</p>
  
  <p>What is the issue?</p>