Sorting Arrays

This is a discussion on Sorting Arrays within the C Programming forums, part of the General Programming Boards category; You all probably have no trouble with this but I do. I am sorting two dimensional arrays. Don't have any ...

Sorting Arrays

You all probably have no trouble with this but I do. I am sorting two dimensional arrays. Don't have any idea how to do this. Never done it before. But this is what I have.
double temp2[][];
long temp1;
for(i = 0; i<emp_counter; i++)
{
for(j = 0; j<emp_counter; j++)
{
if(emp_id[j - 1] > emp_id[j])
{
temp1 = emp_id [j - 1];
emp_id [j - 1] = emp_id [j];
emp_id [j] = temp1;

strcpy(temp2[j-1], last[j]);
strcpy(last[j - 1], last[j]);
strcpy(last[j], temp2[j-1]);
}
}
Is this at all right. It's close. But I don't know what to declare temp2 as.
Sorry if this is considered one of those "Annoying Questions."

First of all, that's code for normal arrays, and second of all it's not entirely correct...well, it is but instead of strcpy you should just use an equals sign. ex: array[1] = array[2]. For multidimensional arrays just add another loop, our you could run an entire sort on array[j][] and another one on array[][j]. Either one works just fine.

sorting

I guess I didn't explain myself very well. I am dealing with a 2D array for double, 2D array for char, char, long and intergers. I am not suppose to use qsort for some reason. I wouldn't be able to have to seperate codes for array[][j] and array[j][] because my teacher is totally into speed and short codes. Here is a part of the code again. Hopefully I can get a little help.
int i, j;
long temp1;
double temp2[][];
char temp3[][];
char temp4;
for(i = 0; i<emp_counter; i++)
{
for(j = 0; j<emp_counter; j++)
{
if(emp_id[j - 1] > emp_id[j])
{
temp1 = emp_id [j - 1];
emp_id [j - 1] = emp_id [j];
emp_id [j] = temp1;