title: How do I strtok through a str and assign each token to an array that is a global variable
body: <p>In this code, I call the input function and assign the input to a global variable. then i parse the global string using <code>strtok()</code> in my <strong>parseFunction</strong> separating it out by the spaces. I assign each token to a global array.</p>
  <pre><code>#define BUFFERSIZE 80
  char input[BUFFERSIZE];
  char parsed[BUFFERSIZE][50];
  
  void getInput() {
        printf(&quot;input command &quot;);
        fgets(input, BUFFERSIZE, stdin);
  }
  
  void parseFunction() {
        int i = 0;
        char* tok;
        char* delim = &quot; \n&quot;;
        while(tok != NULL) {
              parsed[i] = tok;
              i++;
              tok = strktok(NULL, delim);
        }
        parsed[i] = NULL;
  }
  
  int main() {
  
        getInput();
        parseFunction();
  
  }
  </code></pre>
  <p>I am getting the following errors and I cannot understand what is going wrong.</p>
  <pre><code>error: incompatible types when assigning to type ‘char[50]’ from type ‘char *’
           parsed[i] = tok;
                     ^
  shell.c:51:15: error: incompatible types when assigning to type ‘char[50]’ from type ‘void *’
       parsed[i] = NULL;
  </code></pre>