I would like to know how i can read a parameter and also an input while running the program.

assume my program name is "readfile"

I would like to make it in such a way that when i type "readfile parameter < filename", it will run the readfile program and in the program it will read the parameter and also the filename. How can i archieve this ? For your information i am coding this in C and not C++.