Check input redirection in CPP program
We know how REDIRECTION unix shells behave as if the input from a file (eg: input.txt) comes from the keyboard.
So I am making a cpp program that can take input via CIN either with the keyboard or with a text file using redirection
eg: ./ a.out <input.txt
But how can I check in a C ++ program if the input entered was from a file or typed from the keyboard?
+3
source to share