Sunday, July 26, 2009

Help with C++ code please?

ok, so this is my code... or at least my qucksort and concatenate function, will this work? and also why does it keeps telling me invalid conversion from int to int on the line that says "pega(n,cti,ctd,cte);"


void pega(int n,int cti,int ctd,int cte);


void quicksort(int n[],int d);


main()


{ int n[]={123,45,67,87,5,64,12,99,19,3},x;


puts("Arreglo sin ordenar:");


for(x=0;x%26lt;10;x++)


printf("%d - ",n[x]);


quicksort(n,10);


puts("Arreglo ordenado:");


for(x=0;x%26lt;10;x++)


printf("%d - ",n[x]);


getch();


return 0;


}


void quicksort(int n[],int d)


{ int p,min[d],may[d],eq[d],x,cti=0,ctd=0,cte=...


p=n[d];


for(x=0;x%26lt;d;x++)


{ if(p%26gt;n[x])


{ min[cti]=n[x];


cti++;


}


else if(p%26lt;n[x])


{ may[ctd]=n[x];


ctd++;


}


else


{ eq[cte]=n[x];


cte++;


}


}

Help with C++ code please?
change your first 2 lines from:





void pega(int n,int cti,int ctd,int cte);


void quicksort(int n[],int d);





to:





void pega(int, int, int, int);


void quicksort(int [], int);

online florists

No comments:

Post a Comment