Шпаргалка: Реализация списка
{if (BegP==NULL)
{MakeNewList(); return 0;}
int Quant;
cout<<endl<<"Input quantity of elements: ";
do
{cin>>Quant;
if (Quant<1)
cout<<endl<<"Error! Try again: ";
}
while (Quant<1);
for (int i=0; i<Quant; i++)
{cout<<endl<<"Input digit: ";
int Digit;
cin>>Digit;
PList=new List(Digit);
List *PList1=BegP->LPrev;
if (PList1==BegP)
{BegP->LNext=PList;
BegP->LPrev=PList;
PList->LPrev=BegP;
PList->LNext=BegP;
PList1=NULL; PList=NULL;}
else
{BegP->LPrev=PList;
PList->LNext=BegP;
PList->LPrev=PList1;
PList1->LNext=PList;
PList=NULL; PList1=NULL;}
}