Реферат: Объектно ориентированое програмирование на С
last->down->up=current;
last->down=NULL;
current->info=new char[strlen(s)+1];
strcpy(current->info,s);
return;
};
void list::add_before(char* s)
{
if (current==NULL)
{
add_after(s);
return;
};
if (current==first)
{
first=new element[1];
first->up=NULL;
first->down=current;
current=current->up=first;
first->info=new char[strlen(s)+1];
strcpy(first->info,s);
return;
};
first->up=current->up;
current->up=new element[1];
current->up->down=current;
current=current->up;
current->up=first->up;
first->up->down=current;