title: Increment character value of a string
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/164194/why-do-i-get-a-segmentation-fault-when-writing-to-a-string">Why do I get a segmentation fault when writing to a string?</a>  </p>
  </blockquote>
  
  
  
  <p>Here is a small function, was testing something so wrote it. Here i tried to increment a character value of the string literal when i tried doing so i got a segmentation fault. Can you please tell what i am doing wrong here</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int input_string(char *str)
  {
    printf("%s\n", str);
    printf("%c\n", *str);
    printf("%c\n", (*str)++); // I get a segmentation fault here, cant i increment the value like this ?
  }
  void main()
  {
    char *str = "andrew";
    input_string(str);
  }
  </code></pre>