0
arrays
how to display all array elements
3 ответов
+ 4
For example:
for(int i=0; i<arrSize; i++){
cout << a[i] << ' ';
}
+ 2
It must be done by using a loop.
A two-dimensional array requires nested loops.
+ 1
So as written before, you have to use a for loop and nested loops if it is a multiple dimensional array. Compared to C, if you just write :
cout << array ;
You don’t get all elements of the array, but the memory adress and particulary the adress of the first element ( array[0] ).