主题:求助一个F95书上的例题,谢谢求助,
最近自学彭国伦的F95,边学边在电脑上操作,发现彭的书上第45页,有个例子我照抄后运行不了,希望有高手帮忙看下是什么原因小弟不胜感激。原程序如下:
program ex0413
character(len=20) string
string="Good moring."
write(*,*)string
string(6)="evening."!重新设置从第6个字符之后的字符串
write(*,*)string
end
运行之后报错
Compiling Fortran...
D:\fortran\sdf\sdfa.f90
D:\fortran\sdf\sdfa.f90(9) : Error: This name has not been declared as an array. [STRING]
string(6)="evening."!重新设置从第6个字符之后的字符串
^ Error executing df.exe.
sdf.exe - 1 error(s), 0 warning(s)
诚心求帮助,谢谢
program ex0413
character(len=20) string
string="Good moring."
write(*,*)string
string(6)="evening."!重新设置从第6个字符之后的字符串
write(*,*)string
end
运行之后报错
Compiling Fortran...
D:\fortran\sdf\sdfa.f90
D:\fortran\sdf\sdfa.f90(9) : Error: This name has not been declared as an array. [STRING]
string(6)="evening."!重新设置从第6个字符之后的字符串
^ Error executing df.exe.
sdf.exe - 1 error(s), 0 warning(s)
诚心求帮助,谢谢