sparge
Joined: 11 Apr 2005 Posts: 371
|
Posted: Mon Mar 08, 2010 4:25 pm Post subject: Array assignment query |
|
|
I was under the impression that "broadcast" assignment for arrays worked with CHARACTER type variables just like it does for numeric data types. However, in the following program (and using, admittedly, v5.40 rather than v5.50), whilst all the characters in variable astring change their values following the assignment statement, only the first character gets assigned the value char(0); the remainder (somehow) get assigned the value 0x20. Have I been under a false impression or is this behaviour indeed unexpected?
Andy
program array_setting
integer, parameter :: elements = 8
character (len = elements) astring
astring ( = char (0)
stop
end program array_setting |
|