0

What is the general format of a loop to process the elements in column j of a two dimensional array in cpp?

Multidimensional array

18th Feb 2020, 5:42 PM
Aadil Ali
5 Antworten
+ 1
Aadil Ali That is for accessing total array... If you to access only a column, then remove the loop for row, (1st for loop). And give row i value manually, which is corresponding to your retrive column...
18th Feb 2020, 7:07 PM
Jayakrishna 🇮🇳
0
Please tag the language. It differs from python to c to java.
18th Feb 2020, 5:51 PM
Oma Falk
Oma Falk - avatar
0
for(int i=0;i<rowlength;i++) { for(int j=0;j<colomnlength;j++) cout<<array[i][j] <<" " ; cout<<endl; } Where i represents rows, j represents colomns... Is this what you looking...?
18th Feb 2020, 6:56 PM
Jayakrishna 🇮🇳
0
Jayakrishna i wanna access the the columns only
18th Feb 2020, 7:00 PM
Aadil Ali