To: J3 J3/18-147 From: Daniel Chen Subject: Intrinsics to convert C string and Fortran string Date: 2018-February-15 Discussion ---------- It is desired to be able to pass a null-terminated string from Fortran to C or convert a C string to a Fortran string. Proposal -------- Need to create two intrinsic functions as: CSTRING(STRING) 1 Description. Convert a Fortran character string to a NULL-terminated C string. 2 Class. Transformational function. 3 Argument. STRING shall be a character scalar. 4 Result Characteristics. Character with the same kind type parameter value as STRING and with a length that is the length of STRING plus 1 for the NULL terminator. 5 Result Value. The value of the result is the same as STRING except a NULL terminator is appended to the end. FSTRING(STRING) 1 Description. Convert a C string to a Fortran string. 2 Class. Transformational function. 3 Argument. STRING shall be a character scalar. 4 Result Characteristics. Character with the same kind type parameter value as STRING and with a length that is the length of STRING prior to the first NULL terminator if there is one. 5 Result Value. The value of the result is the same as STRING up to the first NULL terminator.