Ответить на сообщение
Вернуться к теме
Вы отвечаете на сообщение:
Автор: DDK (31.03.2007 в 11:53) Мне вот свстретился такой пример:
struct mystruct { char field1[8]; char field2[4]; int field3; int field4; float field5; float field6; }; struct list { mystruct m; list* next; }; struct list *head, *ref, *last; int Add() { ref=last; if((last=(list*) calloc(1,sizeof(list)))!=NULL) { last->next=NULL; if(head!=NULL) { ref->next=last; ref=last; } else { head=ref=last; return 1; } } else { cerr<< "No more memory avaliable"; return 0; } }; void Del() { if(head!=NULL) { while(head->next!=NULL) { ref = head->next; free((list*) head); head = ref; } } return; }; ... и т.д. в том же духе
Ваше имя:
Пароль:
Цитировать Используйте тэги для выделения текста: Код: [code][/code] Жирный: [b][/b] Наклонный: [i][/i] URL: [url][/url]
Сообщение:
Прикрепить: