Click here to Skip to main content
15,887,283 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
If i want to sort this 2 d array , then what should be the code to sort the 2 d array?

arr[][]={10,20,10,40};
Posted
Comments
Mohibur Rashid 12-Nov-11 3:25am    
is this your two dimensional array?

its not your proper two dimensional array...
Sergey Alexandrovich Kryukov 13-Nov-11 10:12am    
Yes, it is, in C++. Could be interpreted as the array 2x2. Sorting criteria is unknown, so the problem is not really defined by OP.
--SA
Stefan_Lang 14-Nov-11 12:31pm    
the way it's written it's 1x4, not 2x2
Stefan_Lang 14-Nov-11 12:30pm    
What do you sort (columns, rows, elements?) and what do you sort it by (e. g. first value of column/row, some norm for column/row, other?).
also, the way you defined it that array is 1x4, did you mean
arr[][]={{10,20},{10,40}};
?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900