首页 > 代码库 > *(char **) != char*

*(char **) != char*

    char *myCharacters[3] = { "TomJohn", "George", "Charles Condomine" };

    

    qsort_b(myCharacters, 3, sizeof(char *), ^(const void *l, const void *r) {

        char *left = *(char **)l;

        char *right = *(char **)r;

        return strncmp(left, right, 1);

    });

    for (int i=0; i<3; i++) {

        printf("%s\n",myCharacters[i]);

    }