We know how REDIRECTION of unix shells behaves as if the input from a file( eg: input.txt) was coming from the keyboard.
So I am making a cpp program that can take input through CIN either by keyboard or by text file using redirection
eg: ./a.out < input.txt
But how can I check in the c++ program whether the input being entered was from a file or typed from a keyboard?