Peng Yu <
peng...@gmail.com> wrote:
> The following fortran programs give identical results. I can not see
> what the difference is between char() and achar() in the manual. Does
> anybody know what the difference is?
On systems that use ASCII character encoding, there is no difference.
That's the case for most systems. Where you will see a difference is on
systems that do *NOT* use ASCII as their default character encoding
(notably IBM mainframes and their ilk).
On those systems achar still uses the ASCII encoding, but char uses the
compiler's default encoding.
Thus achar is more portable in the sense that achar(97) is always a
lower case "a" on all systems. Char(97) will be the same on ASCII
systems, but could in principle be different on other systems.
There are applications for char, but mostly I recommend achar as
achieving what is most commonly desired in the most portable manner.
That being said, many codes willl never end up running on a machine
where it makes a difference.
--
Richard Maine
email: last name at domain . net
domain: summer-triangle