Sponsored By

Sign in to follow this  
iccaros

Help C++

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

Share this post


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

Share this post


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..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this