Помогите, пожалуйста, со списками в си
У меня есть 2 структуры:
struct dano
{char name[40];
int ocenka;
};
struct struk
{struct dano information;
struct tr *next;
struct tr *prev;
};
Ф-я сортировки по оценке (st введен из файла) :
void sort(struct struk *st)
{
struct struk *p = NULL;
if (st != NULL) {
while (st->next != NULL) {
p = st->next;
do {
if (p->information->ocenka < st->information->ocenka) {
int tmp = p->information->ocenka;
p->information->ocenka = st->information->ocenka;
st->information->ocenka = tmp;
}
p = p->next;
} while (p != NULL);
st = st->next;
}
}
}
После компиляции выводится ошибка invalid type argument of '->' (have 'struct dan') вот на этом месте: p->information->ocenka = st->information->ocenka.
Подскажите, пожалуйста, что не так я делаю?
То есть invalid type argument of '->' (have 'struct dano')