We do insurance math development in C since 1993, and the normal callers are PL/1
(on the mainframe platform, there are other platforms, too).

We decided that the main goal is that PL/1 callers feel comfortable, so we never request them to put hex zeroes at the end of the strings that we get, and we never put hex zeroes at the end of the strings that we return (blanks instead, if the strings have fixed length). If the lengths are variable, we pass explicit lengths; if the string to be returned has variable length,
we get a max length on entry and return the actual used length.

We expect and return double float values, which are rounded as exactly as possible (in double float format), but the conversion from and to decimal has to be done by PL/1.

This approach works well for C callers, too - in our experience.

What happens inside our package is of no concern to the callers. There are of course null-terminated strings and functions beginning with str... in some places, although I prefer
the mem... functions.

Kind regards

Bernd



Am 29.06.2013 04:30, schrieb zMan:
Require both? That irritates BOTH groups, and seems to have the weaknesses
of both. I must be missing what you're saying...


On Fri, Jun 28, 2013 at 9:40 PM, David Crayford <[email protected]> wrote:

Why not do both? Use lengths and make sure the string is null terminated.
That's how std::string works in C++ where you can call c_str() to return a
null terminated string.





----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to