I am trying to do an insertion sort program where I sort a 2-D array. I think I am close, but I keep getting so screwy data after array[1][0]. Everything in row one sorts out great and the first element in row 2 is set right, but then it just goes wild.
Here's the source code that I have...
Ok, the program below sorts the individual rows. I need it to sort all the numbers in each position, not just the rows. Any help would be appreciated.
#include <iostream>
using namespace std;
const int rows = 3;
const int cols = 10;
void select_sort( );
int array[rows][cols]={...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.