title: Error: ‘i’ undeclared (first use in this function)
body: <p>I cannot figure out why I'm getting this compiler error.  I have declared <code>i</code> in the for loop, but my control statement doesn't see it. </p>
  
  <p>The error is occurring on this line: <code>if (mystring[cmd_index][i] == '\\')</code></p>
  
  <pre><code>/* 
   * Check for the " character in the mystring 
   * and remove the character if it doesn't have the delimiter
   */
  for (int i = 0; i &lt; strlen(mystring[cmd_index]); i++) {
      if (mystring[cmd_index][i] == '\\') {
          i++;
      } else
      if (mystring[cmd_index][i] == '"') {
          printf("HELLO");
  
          if (i != strlen(mystring[cmd_index] - 1)) {
              shiftLeft(mystring[cmd_index], i + 1, 1);
          } else {
              mystring[cmd_index][i] = '\0';
          }
      }
  }
  </code></pre>
  
  <p>Edit1: I am using <code>gcc</code> version 5.4.0</p>
  
  <p>Edit2: I copied the same code and pasted it right below the original. Then commented out the original. It's compiling now. But when I undo this and use the original code, it won't compile again. Why??</p>