title: I want an array of cstrings separated by white space
body: <p>I am trying to get user input and put it into an array of cstrings separated by a space. When I print the array to the screen though I get nothing. I am sure I am doing something stupid, but I have been stuck trying different ways for a while. Any help would be appreciated. Here is the code. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  
  using namespace std;
  
  void stuff(char command[][25], int length)
  {
      char ch;
  
  
      for(int i = 0; i &lt; length; i ++)
      {
          int b = 0;
          cin.get(ch);
          while(!isspace(ch))
          {
              command[i][b++] = ch;
              cin.get(ch);
          }
  
          command[i][b] = '\0';
          cout &lt;&lt; endl;
      }
  
  
  }
  
  int main()
  {
      char cha[10][25];
      char ch;
      int len = 0;
      while(ch != '\n')
      {
          cin.get(ch);
          if(isspace(ch))
              {
                  len++;
              }
      }
      stuff(cha,len);
      for(int i = 0; i &lt; len; i++)
      {
          cout &lt;&lt; cha[i] &lt;&lt; endl;
      } 
      cout &lt;&lt; len &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>