Home > Software engineering >  Please help have a look at the great god, program where wrong! The below is error message
Please help have a look at the great god, program where wrong! The below is error message

Time:11-02


Void sort (array, n)
An int array [];
int n;
{
Int I, j, k, t;
for(i=0; i{k=I;
for(j=i+1; jIf (array [j] T=array [k].
Array=array [k] [I];
Array [I]=t;
}
}

The main ()
{int a [10], I;
Printf (" enter the array \ n ");
for (i=0; i<10; I++) the scanf (" % d ", & amp; A [I]);
Sort (a, 10);
Printf (" the sorted array: \ n ");
for (i=0; i<10; I++)
Printf (" % d ", a [I]);
printf("\n");
}



The Compiling...
EEE. CPP
D: \ \ Program Files \ Microsoft Visual Studio (x86) \ MyProjects \ AAAA \ EEE CPP (2) : error C2065: 'array' : undeclared identifier
D: \ \ Program Files \ Microsoft Visual Studio (x86) \ MyProjects \ AAAA \ EEE CPP (2) : error C2065: 'n' : undeclared identifier
D: \ \ Program Files \ Microsoft Visual Studio (x86) \ MyProjects \ AAAA \ EEE CPP (3) : error C2448: '& lt; Unknown> ': the function - style, initializer appears to be a function definition
D: \ \ Program Files \ Microsoft Visual Studio (x86) \ MyProjects \ AAAA \ EEE CPP (3) : fatal error C1004: unexpected end of file found
An error occurred when executing cl. Exe.

EEE. OBJ - 1 error (s), and 0 warning (s)

CodePudding user response:

Lz array is what, that want to take the size of the array

CodePudding user response:

You define the parameter type, rather than in C language

CodePudding user response:

Void the sort (int array [10], int n)
{
Int I, j, k, t;
for(i=0; i{k=I;
for(j=i+1; jIf (array [j] T=array [k].
Array=array [k] [I];
Array [I]=t;
}
}

Try
  • Related