There is a procedure for adding a new item to the top of the list. How do I set its value at the beginning so that it doesn’t have a zero. Procedure:

введите сюда код procedure DobBNach(var L:TDList); var NewHead : ^TElem; begin new(NewHead); NewHead^.PNext := L.PFirst; L.PFirst := NewHead; end; 
  • Whom"? Mother loves daughter. - Igor
  • A new item that I add to the list using this procedure. - Denis Lobanov

1 answer 1

 procedure DobBNach(aData: TData; var L: TDList); var NewHead: ^TElem; begin new(NewHead); NewHead^.Data := aData; NewHead^.PNext := L.PFirst; L.PFirst := NewHead; end; ... DobBNach(123, list); 
  • Everything works thank you for your help. - Denis Lobanov
  • This I was stupid sorry for previous comments. - Denis Lobanov
  • @ DenisLobanov On health. Well done, that figured out. Successes! - Igor