Horje
c++ foreach Code Example
c++ foreach
// C++ program to demonstrate use of foreach
#include <iostream>
using namespace std;
  
int main()
{
    int arr[] = { 10, 20, 30, 40 };
  
    // Printing elements of an array using
    // foreach loop
    for (int x : arr)
        cout << x << endl;
}

//output:
//10
//20
//30
//40
cpp foreach
for(type variable_name : array/vector_name)
{
    loop statements
    ...
}




Cpp

Related
c++ print number not in scientific notation Code Example c++ print number not in scientific notation Code Example
sort strings by length and by alphabet Code Example sort strings by length and by alphabet Code Example
ex: cpp Code Example ex: cpp Code Example
c++ while Code Example c++ while Code Example
how to concatinate two strings in c++ Code Example how to concatinate two strings in c++ Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11