I am making a test program that is redirected a text file and the program
is required to store and display the redirected input in an string.
mycprogram < mytextfile.txt
I've been trying to treat the redirect as a stdin input, so something like:
however, this program displays three arbitrary characters on run, instead
fscanf(stdin, "%s", rinput);
fprintf(stdout, "%s\n", rinput);
of the expected output.
Any help is appreciated.
Thanks ahead of time.