So I understand that to read and print out a line of text you can just use printf
, scanf
and type it out. However what if I want to print out a text file without typing them out in terminal? And I don't mean using fopen(filename, "r")
where you can only open a specific file. I think this is called redirection but I'm having trouble understanding it. Something along the line as the below input example:
./myprogram < input.txt