title: Splitting an array without an inbuilt function
body: <p>The code below is meant to take an input string like <code>My name is Smith</code> and outputs </p>
  
  <pre><code>My 
  name 
  is 
  Smith
  </code></pre>
  
  <p>and also has to exclude things like: <code>, . and space</code>, just these three, but instead it outputs, I'm not allowed to use any thing like <code>strlen</code> or <code>strtok</code> </p>
  
  <pre><code>My
  y
  
  name
  ame 
  me
  e
  
  is
  s
  
  Smith
  mith
  ith
  th
  h
  </code></pre>
  
  <p>I've searched for the error everywhere in the code and I can't seem to figure it out </p>
  
  <pre><code>int main()
  {
      int wordSize = 0;
      char str[81];
      char* ptr_to_word[81];
  
      gets_s(str);
  
      for (char* res_p = &amp;(str[0]); *res_p != '\0'; res_p++) {
          if ((*res_p != '.') || (*res_p != ',') || (*res_p != ' '))
          {
              ptr_to_word[wordSize] = res_p;
              wordSize++;
          }
      }
  
      if (wordSize == 0)
      {
          printf("no solution");
      }
  
      else
      {
          for (int i = 0; i &lt; wordSize; i)
          {
              char* a = ptr_to_word[i];
              while ((*a != '.') &amp;&amp; (*a != ',') &amp;&amp; (*a != ' ') &amp;&amp; (*a != '\0'))
              {
                  printf("%c", *a);
                  a++;
              }
              printf("\n");
          }
      }
      return 0;
  }
  </code></pre>