for showing and redirecting at the same time, you can use:
./program 2>&1 | tee program.log
in the file program.log, the statement stores stdout and stderr as well.
for showing and redirecting at the same time, you can use:
./program 2>&1 | tee program.log
in the file program.log, the statement stores stdout and stderr as well.