Reading Arrays with Foreach Loops - C++ Data Type

C++ examples for Data Type:Array

Description

Reading Arrays with Foreach Loops

Demo Code

#include <iostream> 
 
int main() // w  w  w  .j  a v a  2  s.com
{ 
  int production[] = { 1, 2, 3, 4, 10 }; 
 
  for (int year : production) 
  { 
    std::cout << "Output: " << year << std::endl; 
  } 
}

Related Tutorials