title: Copying words from a text file into a 2D array of cstrings - C language
body: <p>Basically I have a text file with a bunch of words separated by spaces. My goal is to copy the words into a 2D array of C-strings. What I've done is scan in a line in the file into a C-string, use <code>strtok</code> to separate each word of the line by the spaces, and use <code>strcpy</code> to copy the words into the 2D array. I also have a counter too keep track of the row of the array that iterates every time I copy a word. How would I go about actually doing the copying?
  What I was thinking is doing something like this:</p>
  
  <pre><code>token = strtok(NULL, " ");
  
  strcpy(Array2D[counter], token);
  </code></pre>
  
  <p>What I'm doing here is copying the token into the column-cstring that lives at the row counter. Is this something that will work in C? Pretty new to C as a language and just started learning about arrays so my knowledge is limited.</p>