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