ok when i have my code as
Code:

#include <stdio.h>
#include <stdlib.h>
#define unit32 unsigned int
#define Max 50 //number to set array
typedef int (*CMPFUN)(int, int);
void ArraySort(int Num[], CMPFUN fun_prt, unit32 ub)
{ //start bubble array
unit32 indx;
unit32 indx2;
int temp;
int temp2;
int flipped;
if (ub <= 1)
return;
indx =1;
do
{
flipped = 0;
for (indx2 = ub-1; indx2 >= indx; --indx2)
{
temp = Num[indx2];
temp2 = Num[indx2 -1];
if ((*fun_prt)(temp2,temp)>0)
{
Num[indx2 -1] = temp;
Num[indx2] = temp2;
flipped =1;
}
}
}while ((++indx < ub) && flipped);
}
int cmpfun (int a, int b)
{
if (a > b)
return 1;
else if (a < b)
return -1;
else
return 0;
}
main ()
{
int Num[Max]; // numbers to be added to array
int i;
for (i = 0; i < Max != 0; i++)
{
printf ("Please enter a random nunber : ");
scanf ("%d", &Num[i]);
if(Num[i] == 0) break;
}
for (i = 0; i < Max; i ++)
{
ArraySort(Num, cmpfun, Max);
printf ("%d\t", Num[i]);
}
printf ("HIT ENTER TO EXIT\n");
getchar();
getchar();
return 0;
}

i get this wrird out put once i hit 0

Code:

Please enter a random nunber : 15
Please enter a random nunber : 9
Please enter a random nunber : 47
Please enter a random nunber : 25
Please enter a random nunber : 9
Please enter a random nunber : 14
Please enter a random nunber : 0
-1 -1 -1 0 0 0 2 8 8 9
9 14 15 16 25 40 47 15944 126488 2292944
2293320 2293528 2293536 2293564 2293728 2368336 3997696 3997696 3997696 3998464
4013640 4013649 4013680 4013696 31849508 2009145456 2009145480
2009252574 2009252579 2009252579 2009252814 2009291924
2009291924 2009312941 2009315348 2089872920 2089878893
2089878896 2089879275 2089879280 HIT ENTER TO EXIT