Recommended Posts

ok I have two constutors

~List(); // destructor

List( const List< NODETYPE > & ); // copy constructor

now I need to create a funtion that passes object of type List to the second constutor

here is my failed try

(If I make this a funtion like void CopyList ( const List< NODETYPE > & ); then I can make it work.. but as a construtor I am lost..)

template<class T>
void concatenate ( List <T> &listObject1, List <T> &listObject2)
{
listObject1.List(const List<string> & listObject2);
}

if I change it to its own funtion it works with this

template<class T>
void concatenate ( List <T> &listObject1, List <T> &listObject2)
{
listObject1.CopyList(listObject2);
}

Edited by iccaros
Link to post
Share on other sites

ok I got the contrutor to call

List <T> tempData = listObject1;

but now I must cantonate two objects.. ?? any one know the logic.. not code just logic..

right now I am tring to call a new object that uses a copy constutor to make a copy of object two.. then copy to the end of the linked list the contents of object two

Thanks

Edited by iccaros
Link to post
Share on other sites

never mind have my answer.. needed to have a pointer to the data... sorry if this is cryptic and if anyone is intrested I will send a coy after next week, but this is for homework, hence I just wanted logic as I need to find th eanswers on my own in code..

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...