title: Double For Loop syntax in C
body: <p>I am new to C and have to write some code that emulates a given function. However, I am having a difficult time understanding what the second for loop in this code is doing, explicitly. The syntax doesn't seem to follow standard for loop syntax of:</p>
  
  <pre><code>for ( init; condition; increment ) {
  statement(s);
  }
  </code></pre>
  
  <p>Here is the code I am examining and it's the second for loop that I am not following and I don't see any online version of this</p>
  
  <pre><code>for (i = 0; i &lt;= (n1-n2); i++){   
      count=0;
      for(j = i,k = 0; k &lt; n2; j++,k++){
          if (*(s1+j)!=*(s2+k)){
              break;
          }
          else
              count++;
          if(count==n2)    
              total++;                         
      }
  }
  </code></pre>
  
  <p>I'm assuming it's two for loops in one, since there are two increments. And I think the inequality is similar to a 'while loop', but I'm not certain. The confusing piece is that there doesn't seem to be a condition for the j loop. I'm not sure if it's a syntax shortcut or if there is a special loop I can not find a resource for online.</p>