Re: Conversion from int to char



michaelmetcalf@xxxxxxxxxxxxxx wrote:
On Aug 29, 4:28 pm, fm2766 <fm2...@xxxxxxxx> wrote:
Hello, I have to convert integers in characters; for example: from
number i=123456 to string c="123456".
I could write in a file the variable "i", and later read it as a
variable "c", but this method seems to me very inefficient.
Some suggestions?

Well, that's almost what you do, however, not to an external file but
to an 'internal' one as defined by your c, as in:

write(c, '(i6)') i

Maybe some thought should be given to giving this process an additional, more intuitive, name. It's such a common question and "Internal file writing and reading" sure isn't the first thing a newcomer thinks of when they want to convert int->character or vice versa.

cheers,

paulv
.