bubble sort a character array in alphabetic order in c

前端 未结 5 462
眼角桃花
眼角桃花 2020-12-22 05:24

I\'m trying to bubble sort a character array in alphabetic order. My code is as follows:

#define CLASS_SIZE 10
#include 

void bubbleSortAWrit         


        
5条回答
  •  春和景丽
    2020-12-22 05:43

    Your s_letters is not properly initialized, yet you access it in:

    *b[j] = a[j-1];
    *b[j-1] = temp;
    

    It's a segfault.

提交回复
热议问题