I just try to make a code to erase duplicate numbers from the array but I can't shrink the array size after erase the number. Here is my code:
for (i=0;i!=n;i++)
{
for (j=i+1; j!=n; j++)
{
if(arr[i]==arr[j])
{
while(j!=n-1)
{
arr[j]=arr[j+1];
j++;
}
n--;
}
}
}
It's not crash but it's not running either so I have no idea what go wrong.