- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Here is my question:
Suppose a particular a file contains the following line (pasted from you know which program):
124
I have the instruction (once):
READ(5,*) A,B,C
Do I get values of 1., 2., and 0.?
Do I get values of 1., 2., and 4.?
I am using the latest Intel Fortran compiler (or composer, I guess).
Does the fortran standard say anything about the repeated tabs should be treated (one separator or two)?
Thanks,
Gabriel
Suppose a particular a file contains the following line (pasted from you know which program):
1
I have the instruction (once):
READ(5,*) A,B,C
Do I get values of 1., 2., and 0.?
Do I get values of 1., 2., and 4.?
I am using the latest Intel Fortran compiler (or composer, I guess).
Does the fortran standard say anything about the repeated tabs should be treated (one separator or two)?
Thanks,
Gabriel
- Balises:
- Intel® Fortran Compiler
Lien copié
1 Répondre
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
The Fortran standard doesn't include tabs as valid in list-directed input - indeed, tab is not even in the Fortran character set. However, the standard treats whitespace, "one or more contiguous blanks", as a value separator. Intel Fortran treats tabs identically to blanks in list-directed input, so your example would get values 1, 2 and 4. Since your input is non-standard, the results are implementation-dependent.
My advice is not to use tabs in list-directed input.
My advice is not to use tabs in list-directed input.

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable