title: Printing an array of characters
body: <p>I have an array of characters declared as:</p>
  
  <pre><code>char *array[size];
  </code></pre>
  
  <p>When I perform a</p>
  
  <pre><code>printf("%s", array);
  </code></pre>
  
  <p>it gives me some garbage characters, why it is so?</p>
  
  <p><a href="http://www.cplusplus.com/reference/clibrary/cstdio/printf/" rel="noreferrer">http://www.cplusplus.com/reference/clibrary/cstdio/printf/</a></p>
  
  <p>This url indicates printf takes in the format of: `int printf ( const char * format, ... );</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #define size 20
  #define buff 100
  char line[buff];
  
  int main ()
  {
      char *array[100];
      char *sep = " \t\n";
  
      fgets(line, buff, stdin);
  
      int i;
  
      array[0] = strtok(line, sep);
  
      for (i = 1; i &lt; size; i++) {
          array[i] = strtok(NULL, sep);
  
          if (array[i] == NULL)
              break;
      }
  
      return 0;
  }
  </code></pre>