title: Function to remove leading whitespace does not change string in caller?
body: <p>I have a function that needs to remove leading whitespace from a string. For some reason, this does not work:</p>
  
  <pre><code>static void remove_leading_spaces(char* line)
  {  
     int i;
     for(i = 0; line[i] == ' '; i++);      //iterate through till whitespace     
     line = line + i;                      //  advance the pointer to point to
                                           //  the first non space character
  }
  </code></pre>
  
  <p>For example, if I have a string with a single leading whitespace, the string will not be altered.</p>
  
  <p>Thanks everyone the answers are correct for remove_leading_spaces!</p>
  
  <p>How would I do this with a string that needs to be returned from the function that calls this function? I have been trying the same approach and I keep getting a segmentation fault? Is it the same exact concept?</p>