where is the run-time error in that code?
void main(){
....
char *fruites[5] = {"apple", "banana", "orange", "apricot", "pineapple"};
bubble(fruites,5,10);
}
void bubble(char *a[], int size, int columns)
{
int j,i;
char * x= new char[columns];
for (int z=0; z<columns;z++){
*(x+z) ='0';
}
for (i = size - 1; i > 0; i--) {
for (j = 0; j < i; j++) {
if (strcmp(a[j],a[j+1]) > 0) {
strcpy(x, a[j]);
strcpy(a[j], a[j+1]);
strcpy(a[j+1], x);
}
}
}
} // sorting