title: How do you use input redirection from a file in C?
body: <p>I'm very beginner-level in coding, C is the only language I have been learning. I've done thorough research on input redirection to a file to try to figure out how it works, but I do not understand where to use the command or exactly how it is used. My question is, where do I put the redirection command line in the program exactly? I know that it looks something like this: ./a &lt; filename.txt , but I have no idea where to put it in the program, or if it even goes in the program? I want to read data from the files into a scanf using a simple loop. Also, the 'a', is that the exact name of the C program you are writing? </p>