давно
Старший Модератор
312929
1973
30.01.2021, 05:48
общий
это ответ
Здравствуйте, KoreanLamer!
Вот примерный вариант нужной функции:
[code lang=C#]
void copyListByPublisher(List_elem* begin, List_elem* & copy)
{
string Letter;
cout << "Input Search Name:" << endl;
cin >> Letter;
List_elem *ptr = begin, *copy_ptr = copy;
while (ptr != nullptr)
{
if (ptr->jrnl.publisher == Letter)
{
if (copy_ptr==nullptr) copy_ptr = copy = new List_elem;
else copy_ptr = copy_ptr->next = new List_elem;
*copy_ptr = *ptr;
copy_ptr->next = nullptr;
}
ptr = ptr->next;
}
}[/code]