home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 19757 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  1.7 KB

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