151. Unit n is connected to fort.n by default for most compilers.#

topic: Input and Output

Note

This tip is a draft1.

For a positive integer n other than 5 or 6 that has not been connected to a file with OPEN,

write (n,*) “hello”

will write to a file with n in the name, such as fort.10 for n = 10, with details up to the compiler.



1

From the perspective of FortranTip Browser, “draft” means that it hasn’t been edited for formatting, hasn’t had corresponding Fortran programs added, the text content hasn’t been enhanced, etc. Draft texts are extracted from the corresponding Tweet using the Twitter API.