text: Q:
  
  How to initialize array and fill with chars from buffer?
  
  I have the following method:
  int create_nodes(Source* source, int maxTokens) {
      int nodeCount = 0;
      Token* p_Tstart = source->tknBuffer;
      Token* p_Tcurrent = source->tknBuffer;
  
      while ((p_Tcurrent - p_Tstart) < maxTokens && p_Tcurrent != NULL) {
          int szWord = p_Tcurrent->t_L;
          char word[szWord];
          //  void *memset(void *str, int c, size_t n)
          memset(word, '\0', sizeof(char)*szWord);
          //  void *memcpy(void *str1, const void *str2, size_t n)
          char* p_T = source->buffer + p_Tcurrent->t_S;
          memcpy(word, p_T, szWord);
  
          if (word == ";") {
              ++p_Tcurrent;
  
              continue;
          }
  
          ++p_Tcurrent;
          ++nodeCount;
      }
  }
  
  source contains a char* buffer. The intent of the method is to first count all tokens in the buffer that are not a ; token (and arrive at how many nodes we will need). Here is the buffer I am using: 11 + 31;. The tokens - by this point - have been created as follows:  
  
  11 
  + 
  31 
  ;
  
  I pass in a token* which contains a start (t_S) and a length (t_L). So, for instance, the token representing the + char:  
  
  t->t_S = 3  
  t->t_L = 1  
  
  At memcpy(...), the debugger jumps to ++p_Tcurrent meaning that nothing was copied to word - essentially an uncaught exception I guess. What am I doing wrong to initialize the word array? And then to fill it with the specific information specified by the token?  
  source.h:
  struct source {
      const char* fileName;
      char* buffer;
      int bufLen;
      Token* tknBuffer;
      Node* nodeBuffer;
      Expression* exprBuffer;
  };  
  
  token.h:
  struct token {
      int t_S;
      int t_L;
  };
  
  A:
  
  This is not right.
  if (word == ";") {
  
  That will compare two pointers and will most likely be false all the time.
  I suspect you meant to use:
  // Test whether the first character is a semicolon
  if (word[0] == ';') {
  
  or
  // Test whether the entire word is a semicolon
  if (strcmp(word, ";") == 0) {
  
  