title: Using strtok to replace parts of a string from input file C
body: <p>So I have a file that is simply "cat dog chicken rat". I'm trying to load it into a string and change one of the words. I have</p>
  
  <pre><code>int main(){
  
      FILE *ifp;
      char *entry;
      char *string;
      char *token;
  
      ifp=fopen("/home/names.txt", "r");
  
      entry=malloc(200*sizeof(char));
      while(fgets(entry,75,ifp)){ 
      }
  
      printf("%s\n",entry);
      token=strtok(entry," ");
  
      while(token!=NULL){
  
          if(token=="dog")
              string="bird";
  
          string=token;
          printf("%s ",string);
          token=strtok(NULL," "); 
      }   
  }
  </code></pre>
  
  <p>However when I try this, it does not replace the word "dog" with "bird". What am I doing wrong?</p>