copy found integer from linked list

How to copy found integer from 1st linked list to 2nd linked list, and then delete it from the 1st linked list? Help please
The only thing I am intersted in is how to COPY it and then DELETE from 1st linked list
Last edited on
Why copy when you could move it if you intent is for it to be removed from the first list? Also, is this your own implementation of a linked list or one from the standard library?
edge6768,
1. yes actually, I can also just remove it from the first list, but I don't know how to do it.
2. it's my own implementation of a linked list
OK, so what you will need to do is:
1. Find the integer in the 1st and keep a pointer to the node/root previous
2. Find where you want to insert the found int in the 2nd
3. Change the appropriate pointer (could be in the front or the back of the list or anywhere inbetween) in the 2nd to the address of the found int
4. Change the previous node/roots' next in the 1st to the node w/the ints next
5. Change any 'size' members of each list appropriately
edge6768, understood. thank you!
Topic archived. No new replies allowed.