Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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.
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #loop
ADD COMMENT
Topic
Name
5+1 =