title: splitting c-string by putting 0's (segfault)
body: <p>A very simple C program: I want to put 0's at some points in a string to obtain sub-strings. But at the first try I get segmentation fault on execution:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;string.h&gt;
  int main() {
          char *a = "eens kijken of we deze string kunnen splitten";
          a[4] = '\0'; // this causes the segfault
          char *b = a[5]; // sort of guessed this can't work...
          printf("%s", a);
  }
  </code></pre>
  
  <p>So the main question: why the segfault at <code>a[4] = '\0';</code> Second I'd like to split this string with the least amount of code, based on string-index...</p>