I've tried Sink and SaveHistory to do this but none worked. I've also tried things such as the code from this question from one of the answers. How to output to the console in C++/Windows. I made everything in an empty solution in Visual Studio 2019.
There weren't any errors but when I did:
ofstream myfile;
myfile.open("Addresses.txt");
myfile << printf << endl;
myfile.close();
return 0;
it printed out random numbers.
//Code I tried
#include <iostream>
using namespace std;
int main (int) {
cout << "This will print to the console!" << endl; // I don't know how to make it read all of the output
}
My goal is to put the whole output of the console in the text file I selected. (Addresses.txt)