Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I just started using gfortran 4.7.2 in Fedora 17. When I tried to use the following a test code, I am not getting output:

    PROGRAM test_ampersand
    IMPLICIT NONE
    PRINT *, 'I am a new learner of' &
     'fortran'
    END PROGRAM test_ampersand

I was expecting the output as:

I am a new learner of fortran
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
519 views
Welcome To Ask or Share your Answers For Others

1 Answer

This should work too:

PRINT *, 'I am a new learner of &
     &fortran'

That is, character literals can be continued across line breaks but each continuation line must have an ampersand in the first non-blank position.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...