How to resolve the algorithm Command-line arguments step by step in the Fortran programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Command-line arguments step by step in the Fortran programming language
Table of Contents
Problem Statement
See also Program name. For parsing command line arguments intelligently, see Parsing command-line arguments. Example command line:
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Command-line arguments step by step in the Fortran programming language
Source code in the fortran programming language
program command_line_arguments
implicit none
integer, parameter :: len_max = 256
integer :: i , nargs
character (len_max) :: arg
nargs = command_argument_count()
!nargs = iargc()
do i = 0, nargs
call get_command_argument (i, arg)
!call getarg (i, arg)
write (*, '(a)') trim (arg)
end do
end program command_line_arguments
> ./a.out -c "alpha beta" -h "gamma"
./a.out
-c
alpha beta
-h
gamma
You may also check:How to resolve the algorithm Nested function step by step in the Lambdatalk programming language
You may also check:How to resolve the algorithm Wireworld step by step in the Java programming language
You may also check:How to resolve the algorithm 24 game/Solve step by step in the OCaml programming language
You may also check:How to resolve the algorithm Call an object method step by step in the Julia programming language
You may also check:How to resolve the algorithm Element-wise operations step by step in the C++ programming language