Question: Write a program in C++ that searches a text file (with no spaces) named test.txt for the substring that is the longest without repeating characters.

Write a program in C++ that searches a text file (with no spaces) named test.txt for the substring that is the longest without repeating characters. A program must be written in main to read input.txt and output to output.txt. Create a function outside of main to determine the substring and length of the substring. The output in output.txt must be formatted neatly into columns containing the original text, the substring, and then the substring length (use setw). You may only use any of the following: iostream, iomanip, cmath, string, fstream, sstream, vector, cstdlib, ctime. Add comments/ explain your process. Example: test.txt will be formatted as: Pepperoni qwertyuiopq hi!! hhhhhhhh 2 Output.txt will contain the text from test.txt followed by the substring and \# of char in the substring
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
