title: Increasing Value of String Pointer in C
body: <p>I am working on an assignment. I have the proper working code, however, I am having trouble understanding what one line does. </p>
  
  <p>The description for a function is: </p>
  
  <p>This function will malloc 5 bytes of memory, store "bird" in those 5 bytes (4 letters plus '\0') using strcpy, and increase the value pointed to by the string pointer by the length of the string (calculated using strlen) that it points to (so it ends up pointing to the '\0' at the end of the sentence).  Then it will return the malloced memory.</p>
  
  <p>Here is the code to do what is described above</p>
  
  <pre><code>char *get_word( char **string_ptr ){
  
      char *word; 
  
      word = malloc( 5 ); 
  
      strcpy( word, "bird" ); 
  
      *string_ptr += strlen( *string_ptr );
  
      return word;
  
  }
  </code></pre>
  
  <p>I do not understand what the line "*string_ptr += strlen( *string_ptr );" does, even with the description above. Could someone give me a more detailed explanation of what happening there? </p>