i have a table
int tab1[25]
i need to organize the values in the table from smallest to largest(there are no numbers repeated) , BUT if the value is -1, then these have to go to the end of all other numbers
and example of the table before the organization would be
{4,7,2,9,5,10,-1,-1,-1,-1,-1,-1,-1,-1.....-1}
after the organization
{2,4,5,7,9,10,-1,-1,-1......-1}
ive been trying to do this for about 1 hour, but i always have some mistake or it just doesnt work, and i dont have much time to lose cause this is a reallly really small part of a project i have to do.Code:void organizer(int tab1[3][25]) { int a,b,c; int tabhelper[25]; for(a=0;a<3;a++) { for(b=0;b<25;b++) { tab1[a][b]=tabhelper[b]; } for(b=0;b<25;b++) { int d; if(tabhelper[b]>tabhelper[b+1]) { d =tabhelper[b]; tabhelper[b]=tabhelper[b+1] tabhelper[b+1]=d; } } } }
thank you in advanced