An A by itself will print the whole string like a %s in C. A followed by a number will print that number of characters from the string. For example A5 is the same as %5s. The equivalent of %c is A1
Also note that format statements in Fortran are not the same as those in C. In Fortran, the output is driven by the data: in C it is driven by the format.
Code:
printf ("%d %d\n", a, b, c, d, e);
write (*, '(I5 I5)') a, b, c, d, e
The C coding will only print the values of a and b. The Fortran coding will print the value of a and b on one line, c and d on the next line, and e on the next line.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.