I have a quick question:
I have a C++ program that prompts the user for inputs, accepts those inputs, does things based on the inputs, and displays the results (everything is being displayed to the shell window using printf). I want to take everything that is being displayed in the shell window and instead write it to a file. If I could make it display in the shell window and also write to the file, that would be even better. Here is what I attempted to do:
I also tried:
Both of these commands do absolutely nothing. The cursor just goes to the next line and sits there (without even a command prompt). The .out file does not run at all. Please help me do this, or let me know if it cannot be done. Thank you.
P.S. The file 'programresult.txt' is created in the directory, but the file is empty.