@Valentin , if it crashes at runtime, then this is not called the “compiler error” (they say runtime error or just runtime error )
Judging by the words "the address is not the one," I can assume that this is a runtime error and an error somewhere in the construction of the list (perhaps last! = NULL, but it points to memory not allocated by new ).
Use the debugger. Helps a lot.
Generally you have a few mistakes here.
one). in delMenu in while you start with last (???), and from the code del () it follows that the list starts with first .
2). the condition in while (r-> inf.id == ID && r-> next! = NULL) is simply wrong (without taking into account error 1). Must be inf.id! = Id
3). in del () operator delete q; it is necessary to pull from else to the end (after all if ). In general, del () is done carelessly (assuming q is on the list).
And finally, this idea of working with the list is ineffective. You run twice (on average half) on the list. If you delete (insert after, before) at the address of a list item, then make a doubly linked list. Then look for when performing such an operation is not necessary.
If for some reason you simply need a simply connected, then do the deletion not by address, but by ID , i.e. Combine search and delete. It will turn out something like
if (!first) cout << "Нет записей"; else { cout<<"Введите номер записи: "; cin>>ID; if (!findDel(ID)) cout<<"Запись не найдена в базе\n"; }