📜  C++,对数组数组进行 for 循环 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:53.749000             🧑  作者: Mango

代码示例1
/*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