Hi, guys. I have a simple question, please help me.
I am learning C program now with emacs and command line. I know that after gcc compiling the .c file. We can use a.out in command line to execute the file and get the result. While we can add some arguments behind a.out for different purpose of input.
For example, we can use a.out < input1.txt.
My question is if there is a argument transferred from a.out. Which parameter should I use to receive this argument? *argv of main()? And how can I open input1.txt in my C program?
Thank you very much.
I am learning C program now with emacs and command line. I know that after gcc compiling the .c file. We can use a.out in command line to execute the file and get the result. While we can add some arguments behind a.out for different purpose of input.
For example, we can use a.out < input1.txt.
My question is if there is a argument transferred from a.out. Which parameter should I use to receive this argument? *argv of main()? And how can I open input1.txt in my C program?
Thank you very much.