Answers for "C++, for-loop over an array array"

C++
0

C++, for-loop over an array array

/*sizeof(array_scores) is a pointer to array_scores[], 
and has to be divided by each first-object[0]*/
for(int a = 0; a < sizeof(array_scores)/sizeof(array_scores[0]); a = a + 1 ){
	cout << "for loop, a = " << array_scores[a] << " at position " << a << "\n";
}
//https://stackoverflow.com/questions/20234898/correct-way-of-looping-through-c-arrays
Posted by: Guest on June-26-2021

Browse Popular Code Answers by Language