I am currently doing a Fortran77 assignment, so please don’t tell me the exact coding, but please give me a hint of what I want to do:
Using UNIX terminal, I would like to get the parameter passed on by executing
./program.exe parameter
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In standard Fortran77 you can’t. End of story. Accessing command line arguments with fortran programs wasn’t standardized until Fortran 2003.
If you’re using the GNU fortran compiler, you can use the
iargc()andgetarg(i, arg)functions, which return the number of arguments and the value of a specific argument, resepectively.