Sorting a mattrix

I am creating a mattrix using an array of [4][5]. I am having problems sorting the mattrix in descending order.
Can someone tell me what I am doing wrong?

int resort (int a[4][5])
{//Error messages is "LOCAL FUNCTION DEFINITIONS ARE ILLEGAL"
int n=20;
int i;
int j;
int temp;
for (i=0; i<n-1; ++i)
{
for (j=n-1; i<j; --j)
{
temp = a[j][j];
a[j][j] = a[j-1][i-1];
a[j-1][j-1] = temp;
}
}
}
return a[0][0];
}

Comments

  • Too many close braces -- remove the brace just before the return statement.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion