Nov 15, 2012 at 10:18am UTC
hm still getting the error :| I think i'm blind.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
void sortarray(int hiredate[], int employee[], int salary[], int totalRecs);
{
{
int temp, end;
for (end = totalRecs - 1; end>=0; end--)
{
for (int count = 0; count < end; count++)
{
if (hiredate[count] > hiredate[count +1]
{
temp = hiredate[count];
[count] = hiredate[count + 1];
hiredate[count + 1] = temp;
}
}
for (int count = 0; count < end; count++)
{
if (employee[count] > employee[count +1]
{
temp = employee[count];
employee[count] = employee[count + 1];
employee[count + 1] = temp;
}
}
for (int count = 0; count < end; count++)
{
if (employee[count] > employee[count +1]
{
temp = employee[count];
employee[count] = employee[count + 1];
employee[count + 1] = temp;
}
}
}
}
Last edited on Nov 15, 2012 at 10:19am UTC
Nov 15, 2012 at 10:37am UTC
line 11,20 and 29 are missing ")"
also you're missing "}" at the end or remove "{" in line 5
Last edited on Nov 15, 2012 at 10:38am UTC
Nov 15, 2012 at 10:51am UTC
i read your codes and i know your mistakes
these are sintax errors!
you should close all blocks at the end of function
you should close all prenthisses at the end of the if, while statements
and after that what errors the compiler gives to you?
What compiler do you use?
Nov 15, 2012 at 10:59am UTC
a general advice
if you write a loop or if statement or anything else using brackets.
write the opening and closing bracket first and then fill it with code, this way you never forget a closing bracket and you dont sit there debugging and looking for errors.
Nov 15, 2012 at 2:49pm UTC
Yes it's correct
my mean isn't arrays
for example
if(expression[])
{
codes;
}
you should close prenthesses after the expression like loops
Nov 15, 2012 at 3:00pm UTC
Line 7 for (end = totalRecs - 1; end>=0; end--)
The test expression is invalid. In fact you have 4 expressions in there.
Nov 15, 2012 at 3:05pm UTC
also, remove the semi-colon at line 3
Last edited on Nov 15, 2012 at 3:05pm UTC