Segmentation fault error.

/this is my code down below,i havent experienced any such error in my compiler but the codechef compiler has.Can anyone please help me out with it./

#include
using namespace std;

void deleteRepeats(char c[],int& size)
{
int num = size;
int start = 0;

while(start != num)
{
    int test = c[start];
    for(int i = start+1; i <= num;i++)
    {
        if(test==c[i])
        {
            for(int j = i;j<num;j++)
                {
                c[j] = c[j+1];
                }
            num-=1;
        }
    }
start +=1;
}
size = num;
c[num]=NULL;

}

void sort(char a[],int &n)
{
char temp;
int j;
for(int i=0;i<n;i++) // Loop for Pass
{

	for(j=i+1;j<n;j++)
	{
		if(a[i]>a[j])
		{
			temp=a[i];                      // Interchange Values
			a[i]=a[j];
			a[j]=temp;
		}
	}

}

}

int main()
{
int i,n;
cout<<“how many numbers”<<endl;
cin>>n;cout<<“Enter the data”<<endl;
char a[20];
for(i=0;i<n;i++)
cin>>a[i];
a[i]==0;
deleteRepeats(a,n);
sort(a,n);
cout<<“The output is”<<endl;
for(i=0;i<n;i++)
{
cout<<a[i];
cout<<endl;
}
return 0;
}

  1. paste it on pastebin.com, and give us a link (for nice viewing your code)
  2. what is the task of this code ?

The code at the bottom is hard to read and contains many misprints. Please do as stasszczesniak suggested.