home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8167 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.3 KB

  1. Path: sparky!uunet!olivea!spool.mu.edu!agate!boulder!csn!boulder.parcplace.com!imp
  2. From: imp@boulder.parcplace.com (Warner Losh)
  3. Newsgroups: comp.windows.x.motif
  4. Subject: Re: XmStringCreate* declarations
  5. Message-ID: <BzMwEM.3z1@boulder.parcplace.com>
  6. Date: 22 Dec 92 00:08:45 GMT
  7. References: <1g8ql0INNh4p@hpsdlss3.sdd.hp.com> <1992Dec14.155039.2832@lsl.co.uk>
  8. Sender: news@boulder.parcplace.com
  9. Organization: ParcPlace Boulder
  10. Lines: 20
  11.  
  12. In article <1992Dec14.155039.2832@lsl.co.uk> snail@lsl.co.uk writes:
  13. >There is no need, and indeed I understand that doing so would be incorrect.
  14. >Most of the strings I create using XmStringCreate...() are supplied with a
  15. >temporary C string, which is either in a static array of known size or has
  16. >been dynamically created using (m/c/re)alloc() routines. In either case the
  17. >string is not a constant.
  18.  
  19. You have gotten the meaning of const char * wrong.  When you pass a
  20. char * to a routine that has a const char * in that position, it is
  21. automatically converted for the duration of that routine.  The
  22. declaration is a promise to the compiler that the routine won't change
  23. the value of the string, not that you must pass it a string whose
  24. value can't change.
  25.  
  26. Warner
  27.  
  28.  
  29. -- 
  30. Warner Losh        imp@boulder.parcplace.COM    ParcPlace Boulder
  31. I've almost finished my brute force solution to subtlety.
  32.