小编Ped*_*677的帖子

分段故障(核心转储) - 结构;

所以我有以下问题:

我有这个 struct ListAut

struct ListAut{
    char* biggestn;
    int sizeof_biggestn;
    int total_len;
    struct node* avl;
};
Run Code Online (Sandbox Code Playgroud)

它typedef是因为它如下:

typedef struct ListAut *IndexOfAuts;

IndexOfAuts *newIndexOfAuts()
{
    int i;
    IndexOfAuts *ioa = malloc(27 * sizeof(struct ListAut));

    for (i = 0; i < 27; i++)
    {
        ioa[i]->biggestn = "";
        ioa[i]->sizeof_biggestn = 0;
        ioa[i]->total_len = 0;
        ioa[i]->avl = NULL;
    }
    return ioa;
}

void insertName(IndexOfAuts * ioa, char *nome)
{
    char *aux = malloc(sizeof(nome));

    aux = trim(nome);
    int index = getIndexOfLetter(aux);

    if (nameLen(aux) …
Run Code Online (Sandbox Code Playgroud)

c

0
推荐指数
1
解决办法
150
查看次数

标签 统计

c ×1