C_CHAR weird behaviour, arguments function concatenation.
cyril giraudon
cyril.giraudon@free.fr
Thu Dec 18 15:20:00 GMT 2008
Tobias Burnus a écrit :
> Cyril Giraudon wrote:
>
>> error = say("hello", "boy")
>>
> In C strings need to be terminated by '\0'. Thus you need to use
> //c_null_char, e.g.
>
> error = say(c_char_"hello"//c_null_char, c_char_"boy"//c_null_char)
>
> (In the example I used c_char_'string' to make sure that the string
> is of the right kind (c_char) and not of the default kind; in gfortran
> and in most other compilers "default" and c_char_"kind" are equivalent
> but as this is not guaranteed by the standard ...)
>
> Tobias
>
>
>
Thanks a lot for your help.
Cyril.
More information about the Fortran
mailing list