Add a std:::vector<std::string>& argument to print_all_strings. Create an empty std::vector<std::string> object in main. In print_all_strings, in addition to printing the string (cout << prefix + set[j] << endl;), push_back it onto the vector.
Instead of me giving you the code, I would prefer that you post the code that gives you errors. I would rather you learn from the mistakes you made than give you a ready-made solution. I will gladly help you correct your mistakes, but I want to see your effort.
BTW, make sure you use code tags: Click the Format button that looks like "<>", and paste your code in between the code tags that are generated in the text box.