title: strtok changing value of pointer
body: <p>i have the following code:</p>
  
  <pre><code>char* pathTokens;
  char* paths;
  paths = getFilePaths();
  
  //printf("%s", paths);
  
  pathTokens = strtok(paths, "\n");
  
  updateFile(pathTokens, argv[1]);
  </code></pre>
  
  <p>and these variables in the same file as updateFile():</p>
  
  <pre><code>static FILE* file;
  static char content[1024];
  static char* token;
  static int numChanges = 0;
  
  static char newContent[1024];
  </code></pre>
  
  <p>Here is updateFile():</p>
  
  <pre><code>void updateFile(char pathTokens[], char searchWord[]) {
      while(pathTokens != NULL) {
          printf("Token: %s\n", pathTokens);
          updateNewContent(pathTokens, searchWord);
  
          pathTokens = strtok(NULL, "\n");
      }
  }
  </code></pre>
  
  <p>and updateNewContent():</p>
  
  <pre><code>static void updateNewContent(char fileName[], char searchWord[]) {
      if(searchWord == NULL) {
          printf("Please enter a word\n");
          return;
      }
      numChanges = 0;
      file = fopen(fileName, "r");
  
      if(file == NULL) {
          printf("Error opening file\n");
          return;
      }
  
  
      while(fgets(content, 1024, file) != NULL) {
          token = strtok(content, " ");
      }
      fclose(file);
  }
  </code></pre>
  
  <p>whenever <code>token = strtok(content, " ");</code> is called, the value of <code>pathTokens</code> changes. if i comment it out, <code>pathTokens</code> maintains its original values. i don't want <code>pathTokens</code> to change, so why is <code>strtok</code> modifying it?</p>