- 939 名前:937 mailto:sage [2007/11/05(月) 01:33:05 ]
- 気になったので簡単にテストしてみました。
サブルーチン内で普通に文字列代入する(sub1)のと直接要素に代入する(sub2)のとでは違うようですね。 後者は通常の配列と同様な参照渡しなのに対し、前者は少し違った処理をする、ということでしょうか? implicit integer(i-n) character*3 text1 /'aaa'/ character*3 text2 /'aaa'/ call sub1(text1) write(*,*) text1 call sub2(text2) write(*,*) text2 end subroutine sub1(text) character*2 text text = 'b' end subroutine sub2(text) character*2 text text(1:1) = 'b' end <結果> b a baa
|

|