Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
C++ Strings, instream, delete duplicates
Ok i need help i can't figure out how to instream into a string or the algorithm.
[b]Write a C++ Program that uses:[/b]
Passing Strings to functions
Files Input and output.
Write a function called removeRepeats that, given a string, removes any repeated letters and returns a new string.
Write a main method that reads words (strings) from a file and writes the new strings (no repeated letters) to another file.
Several options are left for the programmer to determine:
Use of either c-string(char arrays) or the class strings .
Use of a container (array or vector) to store the strings. You can either store the strings in an array or vector - or just read and write without storage.
As you can see, many of the implementation details are left up to the programmer. At this point in the course you should be able to make design decisions based on good programming practices.
Sample input is a file that will be entered by a user and contains words. Note case should not matter but should be able to compare and delete. my example is
it should then out put like the following
Gy or gy
0 · ·