Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ for each loop

int arr[] = { 10, 20, 30, 40 };
for (int x : arr)
{
	// Stuff with x
  	// x will first have 10, then 20 and so on.
}
Comment

for_each c++

for_each( InputIt first, InputIt last, UnaryFunction f );
//Example
vector<int> v{ 1, 2, 3, 4, 5 };
for_each(v.begin(), v.end(), [](int i) { cout<<i<<" "<<endl; });
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ function pointer as variable 
Cpp :: if not c++ 
Cpp :: c++ concatenate strings 
Cpp :: cpp custom exception 
Cpp :: c language all keywords in string 
Cpp :: ex: cpp 
Cpp :: abs in c++ used for 
Cpp :: enum in c++ 
Cpp :: c++ vector operations 
Cpp :: c++ get index of map element 
Cpp :: cpp compiler online 
Cpp :: queue cpp 
Cpp :: c++ bit shift wrap 
Cpp :: cuda shared array 
Cpp :: InstallUtil.exe ConsoleApp 
Cpp :: Common elements gfg in c++ 
Cpp :: vector keyword in c++ 
Cpp :: parking charge system project c++ 
Cpp :: find no of occurences of each letter in string c++ 
Cpp :: nmake.exe is not found in the windows 
Cpp :: 0-1 knapsack problem implementation of code input array 
Cpp :: find substring after character 
Cpp :: javidx9 age 
Cpp :: how to use mersenne_twister_engine in c++ to generate random numbers 
Cpp :: c++ vector allocator example 
Cpp :: sento freddo a un dente 
Cpp :: c/c++ pointers 
Cpp :: traverse string in cpp 
Cpp :: C++ OpenCV Face Recognition 
Cpp :: run program until ctrl-d c++ 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =