Hi friends..i have written this function for radix sort

But as usual there are errors!! plz cud u modify the code and also add the void main to it...
CODE
# define NUMLETS 5
void radixsort(int x[],int n)
{
int front[20],rear[10];
struct
{
int info;
int next;
}node[NUMLETS];
int exp,first,i,j,k,p,q,y;
/*Initialize the linked list*/
for(i=0;i<n-1;i++)
{node[i].info=x[i];
node[i].next=i+1;
}
node[n-1].info=x[n-1];
node[n-1].next=-1;
first=0;
for(k=0;k<5;k++)
{
rear[i]=-1;
front[i]=-1;
}
/*processing each element of the list*/
while(first!=-1)
{
p=first;
first=node[p].info;
exp=power(10,k-1);
j=(y/exp)%10;
q=rear[j];
if(q==-1)
front[j]=p;
else
node[q].next=p;
}
for(j=0;j<10&&front[j]==-1;j++)
;
first=front[j];
while(j<=9)
{
for(i=j+1;i<10&&front[i]==-1;i++)
{
if(i<=9)
{
p=i;
node[rear[j]].next=front[i];
}
j=i;
}
node[rear[p]].next=-1;
}
/*copy back to original array*/
for(i=0;i<n;i++)
{
x[i]=node[first].info;
first=node[first].next;
}
}