title: C - Incrementing not working after break statement
body: <p>Why does this not work?</p>
  
  <pre><code>short pStringCt = 0;
  const char* constInBuf = ibuf;
  int j;
  for (j = 0; j &lt; i; j++)
  {
      /*Detect when there's a space in the buffer and grab word*/
      if (ibuf[j] == ' ' ||
          ibuf[j] == '|' ||
          j == i - 1)
          {
              int k;
              for (k = j - 1; k &gt;= 0; k--){
  
                  if (k == 0 || ibuf[k] == ' ' || ibuf[k] == '|')
                  {
                      if (pStringCt &gt; 0){
                          pString[pStringCt] = strndup(constInBuf + k + 1, j - k + 1);
                          printf("-pString at %d is: %s\n", pStringCt, pString[pStringCt]);
                          pStringCt += 1;
                      }
                      if (pStringCt == 0){
                          pString[pStringCt] = strndup(constInBuf+k, j-k + 1);
                          printf("-----pString at %d is: %s\n", pStringCt, pString[pStringCt]);
                          pStringCt+=1;
                      }
                      printf("%d is pStringCt\n", pStringCt);
                      break;
                  }
              }
          }
  </code></pre>
  
  <p>The value of pStringCt is not incrementing after the break statement. In other words, pStringCt is 0 to begin with at the start of the method. Then, it increases to one after the two if statements pertaining to it. But after the break statement, it resets to zero...</p>