Originally Posted by
stodd04
I am having problems with bubble sorting a 2d array. I know I need 3 loops but I do not know where to put the third. any help would be greatly appreciated.
Could you elaborate on your expected input and output?
Code:
int array[][3] =
{
{6,5,4},
{7,9,8},
{2,1,3},
};
Would you expect this to be sorted into this?
Code:
{
{1,2,3},
{4,5,6},
{7,8,9},
}
How are you evaluating less than, greater than, and equal to for each "row"? And do you intend to also sort within each "row"?
Or is the "2D array" really an array of strings?