title: Breaking down string and storing it in array
body: <p>I want to break down a sentence and store each string in an array. Here is my code: </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  int main(void)
  {
      int i = 0;
      char* strArray[40];
      char* writablestring= "The C Programming Language";
      char *token = strtok(writablestring, " ");
  
  
      while(token != NULL)
      {
          strcpy(strArray[i], token);
          printf("[%s]\n", token);
          token = strtok(NULL, " ");
          i++;
      }
      return 0;
  }
  </code></pre>
  
  <p>It keeps giving me segmentation error and I cannot figure it out. I believe it has something to do when I copy the token to my array.</p>