0
operator + for linked list
the operator must return the fusion of the two list but when the items are the same valuer only shows in the returned list. i did i for to scroll through the first list while the next pionter is null but it does get out of the for. I try to change it to a while and happened the same thing. The code is in portuguese so i didn't put it here. Sorry for my bad english and if the explanation isn't clear enough.
9 Respostas
+ 2
CiberNinja Yes, put all of your files here. Or if you can merge them into one.
+ 1
The definition about doing what for the same value + is unclear.
For example: what is {1, 3, 5} + {5, 4, 3} ?
Another thing is that without your code we can't really help, especially everyone has their way to implement linked list.
+ 1
CarrieForle
Sorry to have taking do long but it was late here.
Heres my code:
https://code.sololearn.com/ca192a81A23A/?ref=app
I try to comment in english so it can help you undertand it.
Thanks again
+ 1
Martin Taylor thanks for the help. I will have a look at links
+ 1
Martin Taylor i look at the links and gave more information about linked lists. Thanks!
But for this code i need to find a way of doing the operator + with yhe methods that i have
0
The example woudl be: {1,3,5,4}
I will try put the code here but i have more them one file so i might need to put it all right?
And thanks for trying to help
0
I think i figure out my problem. Someone knows how can i pass the head of the new list to the class CListaInteiros? I try by pointer but no luck. I try to do:
CListaInteiro *prt_new = novo.cabeca (the head of the new list )
and them retun prt_new but it was an erro
0
Thanks everyone who try to help! I end up founding my mistake :)