I am trying to read a file from the command line passed as input. No not the filename. I'm not expecting the user to input a filename on the command-line, so that I could open it like this : fopen(argv[1], "r");.
I am expecting a file like this : myprogram < file_as_input. So whatever should go into argv is the contents of the file. How do I do this in C/C++ ?
eachalso): How to read data from unknown input type (filestream or stdin) C<on comment line is redirection operator.