Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

range based for loop c++

array<int, 5> values = {1, 2, 3, 4, 10};
// the type declaration below must be consistent with the array type
for (int x : values){ //we use a colon instead of in
cout << x << endl;
}
 
PREVIOUS NEXT
Tagged: #range #based #loop
ADD COMMENT
Topic
Name
6+4 =