logo

Crowdly

Browser

Додати до Chrome

We want to 'destroy' a list, i.e. free() all the cells in it. we propose the fo...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

We want to 'destroy' a list, i.e. free() all the cells in it.

we propose the following function :

void destroyList(t_list *ptr_list)

{

   t_cell *cur;

   t_cell *prev;

   while (ptr_list->head !=NULL)

   {

      cur = ptr_list->head;

      prev = cur;

      while (cur->next != NULL)

      {

           prev = cur;

           cur = cur->next;

      }

      prev->next = NULL;
      free(cur);

}
}

 

What can you say about this function? (several answers)

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.myefrei.fr?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome