I know that in Linux or Windows I can redirect the output of a program to be saved to a file instead of being displayed on the end with the command >
:
./a.out > arqSaida.txt
Or write at the end of the file instead of replacing it:
./a.out >> arqSaida.txt
Is there a way to show the output of the program in the terminal so I can monitor its execution and at the same time save the output to a file? Remember that I only have the program compiled, so I can not change it!