heloo

Pages: 12
you have to include the library algorithm because std::unique is in there.
Add this to the other #include - directives
#include <algorithm>
I put them and still does not work
I am doing something wrong
please help!!
Last edited on
Oh no, I'm sorry, std::unique only works on sorted vectors and does something completely different, you want non-unique items but std::unique gives you all items exactly once...

seems like you have to invent your own algorithm for removing non-unique items
and how they do it?
I need this
if I have in file1.txt
Line A
Line C
Line D

in the second file2.txt
Line B
Line C
Line D
Line E

the output file to appear :
Line C
Line D
in output file I must heve only the duble words D and C
Last edited on
try it yourself, for loops are a good start
There is nothing better in my program
can you help me?
Last edited on
what do you mean?
There is nothing good in my program?
sure, your program works fine!

You just have to find a way to remove all unique elements.
how I do this thing
I am a beginner and I need this project
help pls
I am a beginner and I need this project
The only way to get better is by doing stuff yourself...

for(int i = 0; i < fileLines.size(); ++i) { /* do something with each element */ }
Last edited on
I put for(int i = 0; i < fileLines.size(); ++i) in my main program
I promise you I study what you show me on this program
Last edited on
That won't do anything yet...

You have the chance to study by inventing your algorithm, that's far more efficient! ;)
anybody help me
Topic archived. No new replies allowed.
Pages: 12