title: C programming copying an array of char to a 2d array of char
body: <p>In this part of the project I'm trying to copy an array of char that has spaces into a 2D array of char where I want to separate each string in the 1D array before spaces and put it into the 2D array of char.</p>
  
  <p>This is my code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int tracker = 0;
      char string[100];
      int b1 = 0;
      int b2 = 0;
      char bitString[100][8];
  
  
      printf("Project Zero\n");
  
      printf("Enter an 8-bit Binary Number!\n");
  
      gets(string);
  
      memset(&amp;bitString[0], 0, sizeof(bitString));
  
      while(string[tracker] != '\0')
      {
          if(!isspace(string[tracker]))
          {
              bitString[b1][b2] = *(string+tracker);
              b2++;
              tracker++;
          }
          else
          {
              b1++;
              tracker++;
              b2=0;
          }
      }
  
  
      printf("String is: %s\n",*(bitString+0));
      printf("String is: %s\n",*(bitString+1));
  
  return 0;
  }
  
  </code></pre>
  
  <p>My input is this: 00001111 00001100</p>
  
  <p>The result is this:
  String is: 0000111100001100</p>
  
  <p>String is: 00001100</p>
  
  <p>I don't understand why the result for *(bitString+0) is all of the strings I entered without space.
  Can someone please explain to me why this is happening and what can I do to fix it.</p>