Mega Code Archive

 
Categories / C++ Tutorial / Operators Statements
 

For loops with null statements

#include <iostream>    int main()  {      int counter = 0;        for( ; counter < 5; )      {          counter++;          std::cout << "Looping!  ";      }        std::cout << "\nCounter: " << counter << ".\n";      return 0;  } Looping! Looping! Looping! Looping! Looping! Counter: 5.