“CPP foreach” Code-Antworten

C fürach

// 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
Solstice

CPP foreach

for(type variable_name : array/vector_name)
{
    loop statements
    ...
}
Kayomez

Ähnliche Antworten wie “CPP foreach”

Fragen ähnlich wie “CPP foreach”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen