0

これは私の比較機能です...

int nameSort(const struct dirent** file1, const struct dirent** file2){

    char* a = *file1 -> d_name;
    char* b = *file2 -> d_name;
    //printf("comparing %s     AND    %s\n", a, b);
    return strcasecmp(a,b);
}

am error: request for member 'd_name' in something not a structure or union 何が問題なのですか?

4

1 に答える 1

1

ポインター演算子による->メンバー選択の優先*度は防御演算子よりも高いため、

 *file1->d_name;

次のようにする必要があります。

 (*file1)-> d_name;
于 2013-08-24T20:33:30.953 に答える