c++ - Delete duplicates from an array of objects -
I have to remove the duplicate from an array of objects, but so far my algorithm gives me mistakes: < (* Album *) request for member 'writer') - & gt; Album :: songs',
The type of indicator type 'song *' (perhaps you use '- & gt;')?
Then this code is:
Zero Album: deleteDuplicates () {songs * on, * end = songs + top - 1; (Current = songs + 1; song and lift; end; songs ++, current = song + 1) {while (current & lt; = end) {if (current-> gt; author == songs.author & amp; amp; current- & gt; title == * songs.tatal & amp; current-> years == * song year and current-> length == * songs) { * Current = * end -; } And {current ++; }}}} How to fix any thoughts?
The compiler error must be removed with the following code.
If (current-> author == song-> author and current-> title == song-> title = ^^ ^^^ ; Current; & gt; year == songs-> year and current-> length == songs-> length) ^^^ ^^^
Comments
Post a Comment