Creating a copy constructor for a linked list
This is homework I'm working on implementing a linked list class for my C++ class, and the copy constructor has be very confusing for me. The linked list is comprised of structs called Elems: struct Elem { int pri; data info; Elem * next; }; Elem * head; info is a separate, custom class that is stored in the Elem. the signature for the copy constructor is: linkedList::linkedList( const linkedList &v ) The issue I am having is mostly taking my logic and actually writing it as code. My general idea is to: Set head to v.head (head = v.head) Set the Elem's values to v's (pri = v.pri , info = v