For Programmers: Free Programming Magazines  


Home > Archive > Fortran > March 2004 > Re: Is there any standered function which converts a character array to a character









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Is there any standered function which converts a character array to a character
Jugoslav Dujic

2004-03-27, 12:18 am

Arjen Markus wrote:
| Noby wrote:
||
|| Is there any standered function which converts a character array to a
|| character string?
||
|| (I use G77 compiler)
|
| Not to my knowledge, but it is not that hard to do:
|
| subroutine carstr( array, string )
| character*1 array(*)
| character*(*) string
| do 110 i = 1,len(string)
| string(i:i) = array(i)
| 110 continue
| end

In addition, a character array and a character string are safe
to EQUIVALENCE mutually -- that avoids the copy. However, it's
not applicable everywhere (e.g. if one is a dummy argument).

--
Jugoslav
___________
www.geocities.com/jdujic

Please reply to the newsgroup.
You can find my real e-mail on my home page above.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com