title: How to store temp value for strtok without changing the initial token
body: <p>Here is part of my code:</p>
  
  <pre><code>int main ()
  {
  char *sentence;
  char *token;
  
  int counter = 1;
  sentence = (char*)malloc(255*sizeof(char));
  
  scanf("%[^\n]s", sentence);
  token = strtok(sentence, " ");
  
  char *temp;
  
  while(token != NULL)
  {
      printf("Token %d: %s\n", counter, token);
      token = strtok(NULL, " ");
      //temp = token;
      //temp = strtok(NULL, " ");
  
      counter++;
  }
  return 0;
  }
  </code></pre>
  
  <p>If I run this when i type: "why herrow there" it gives me:</p>
  
  <pre><code>Token 1: why
  
  Token 2: herrow
  
  Token 3: there
  </code></pre>
  
  <p>If I uncomment the temp then it only gives me:</p>
  
  <pre><code>Token1: why
  
  Token 2: herrow
  </code></pre>
  
  <p>It seems even tho I think I didn't hinder my token value with temp, it still affects my token value. I don't want temp to have any affect on my original token. How do I do that?</p>