Re: Conversion from int to char
- From: e p chandler <epc8@xxxxxxxx>
- Date: Fri, 29 Aug 2008 14:52:52 -0700 (PDT)
Paul van Delst wrote:
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.
Oh no. Let the C programmers learn some Fortran instead of whining
about it. Learning a foreign language involves learning its idioms. To
a FORTRAN programmer, the concept of "internal file" makes sense.
- e
.
- Follow-Ups:
- Re: Conversion from int to char
- From: Ron Ford
- Re: Conversion from int to char
- References:
- Re: Conversion from int to char
- From: Paul van Delst
- Re: Conversion from int to char
- Prev by Date: Re: busting sp datatypes
- Next by Date: Re: Project dependency of CVF 6.6c
- Previous by thread: Re: Conversion from int to char
- Next by thread: Re: Conversion from int to char
- Index(es):