I'm trying to complete a radix sort program, and i cant remember the algorithm to get the specific digit out of a number between 1 and 10000
heres the for loop which calls getdigit:
for( i = 0; i <= 4; i++ ){
printf("Pass %d: ", i );
for( j = 0; j < n ; j++ ){
digit = getdigit( A[j] , i-1 );
appendanumber( &Bins[digit], a[j] } ;
}
refill( A, Bins );
for( k = 0; k < 20; k++ ) printf(" %d ", A[k] );
printf("\n");
}
any help would be appreciated, after i understand getdigit ill attempt refill and might have a question on that as well