home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!psinntp!cmcl2!rlgsc.com!gezelter
- From: gezelter@rlgsc.com
- Newsgroups: comp.os.vms
- Subject: Re: cdd and c
- Message-ID: <1992Dec22.114334.296@rlgsc.com>
- Date: 22 Dec 92 11:43:34 EST
- References: <9212212036.AA25675@top.magnus.acs.ohio-state.edu> <1992Dec22.004144.17281@nntpd2.cxo.dec.com>
- Organization: Robert Gezelter Software Consultant, Flushing, NY
- Lines: 28
-
- In article <1992Dec22.004144.17281@nntpd2.cxo.dec.com>, winalski@adserv.enet.dec.com (Paul S. Winalski) writes:
- >
- > 1) In your C program, process the string without requiring the NUL terminator.
- > This means avoiding functions such as strlen(), strcpy(), and the %s
- > formatting directive in printf(), all of which assume that a string is
- > NUL-terminated.
- >
-
- Agreed.
-
- > 2) Define the field in your CDD record to be one character bigger than it
- > has to be (this is the CDD equivalent of saying char x[7] when you want x
- > to hold a string with 6 characters in it). Then just ignore the last
- > character position in your COBOL code.
- >
-
- Please remember to initialize the value of the "dead" byte to a
- NUL (%X00). If you forget it, you might be surprised one of these
- days.
-
- - Bob
- +--------------------------------------------------------------------------+
- | Robert "Bob" Gezelter E-Mail: gezelter@rlgsc.com |
- | Robert Gezelter Software Consultant Voice: +1 718 463 1079 |
- | 35-20 167th Street, Suite 215 Fax: (on Request) |
- | Flushing, New York 11358-1731 |
- | United States of America |
- +--------------------------------------------------------------------------+
-