title: Working with tokenizing in c
body: <p>I am trying to tokenize a line and put it into a two dimensional array so far I have come up with this but I feel I am far off:</p>
  
  <pre><code>/**
   * Function to tokenize an input line into seperate tokens
   *
   * The first arg is the line to be tokenized and the second arg points to
   * a 2-dimentional string array. The number of rows of this array should be
   * at least MAX_TOKENS_PER_LINE size, and the number of columns (i.e., length
   * of each string should be at least MAX_TOKEN_SIZE)
   *
   * Returns 0 on success and negative number on failure
   */
  
  int __tokenize(char *line, char tokens[][MAX_TOKEN_SIZE], int *num_tokens){
  
  char *tokenPtr;
  tokenPtr = strtok(line, " \t");
      for(int j =0; j&lt;MAX_TOKEN_SIZE; j++){
        while(tokenPtr != NULL){
          if(!(tokens[][j] = tokenPtr)){return -1;}
              num_tokens++;
              tokenPtr = strtok(NULL, " \t");
          }
      }
    return 0;
  }
  </code></pre>