This is what I have added:
{
if (list1 == NULL)
{
cout << "Listnode 1 does not exist";
return 0;
}
while (list1 != NULL)
list1 = list1->next;
if (list2 == NULL)
{
cout << "Listnode 2 does not exist";
return list1;
}
list1->next = list2;
return list1;
}
please use code tags it will be difficult for everyone to read
Did you run your program? i don't think you are doing right. concatenaion works like list1+=list2.