We all know there're two way to redirected the standard output.
First, we can use freopen_s to redirected the stdout and stderr to a file.
Second, we can redirected the stdout and stderr when we call the executable file like this: xxx.exe > log.txt 2>&1.
So my problem is that how can I know where the stdout and stderr has been redirected.
I met this problem in my program in such a situation: If the user redirected the standart output by the second way, I should redirected it to "CON", and print some logs to the console. If the user didn't redirect it, I should not print these logs to the console.
This is because if the user didn't redirected it, these logs had already be printed to the console.