title: How can I split a char* into substrings in C?
body: <p>I have a text like this:</p>
  
  <pre><code>char* str="Hi all.\nMy name is Matteo.\n\nHow are you?"
  </code></pre>
  
  <p>and I want to split the string by "\n\n" in to an array like this:</p>
  
  <pre><code>char* array[3];
  array[0]="Hi all.\nMy name is Matteo."
  array[1]="How are you?"
  array[2]=NULL
  </code></pre>
  
  <p>I've tried the strtok function but it does not split the string correctly.</p>