Trying to run a C program on unix but a little confused with how input file is handled : I've tried to search for this but I'm having trouble figuring how to phrase my question so I figured I'd just ask here.

So I'm trying to run a C program in a unix environment and I have an input file as well. The teacher said we can run it by typing in "gcc programName ./a.out inputFile" or "gcc programName ./a.out inputFile > viewFile"

My question is how is this handled within the C program? Like is the input file being added as a parameter for main (or like its name or something) or is it acting like it's reading from system.in or something else? I'm getting a message saying that there's an error opening the input file and I have "int main(int argc, char* argv[])". If someone could explain what's going on and how the input file is handled, I'd really appreciate it.