Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!adm!Alan_T._Cote.OsbuSouth@Xerox.COM From: Alan_T._Cote.OsbuSouth@Xerox.COM Newsgroups: comp.lang.c Subject: Re: Null-terminated C strings Message-ID: <11467@brl-adm.ARPA> Date: 25 Jan 88 19:06:41 GMT Sender: news@brl-adm.ARPA Lines: 19 In article <2294@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes: >|"The \c escape at the end of a string literal suppresses the trailing NUL. >|If it appears other than at the end, it is ignored, but may serve to separate >|an octal or hex escape from a following digit." [Proposed wording] > >So, what do y'all think? Is this a good idea? Should the two features both >exist but have different notations? (That was my original plan, with "\c" to >suppress the NUL and "\z" to represent a zero-width separator.) The idea of an escape to suppress the trailing NUL is, I think, a good one. However, I would recommend a different escape to represent a zero-width separator, as follows: Use the string concatenation facility! The sequence, "" should suffice to do the job. For example, ... EX#1: char *a="\0101\z3"; /* using Karl's idea */ EX#2: char *a="\0101""3"; /* my suggestion */ Wouldn't EX#2 accomplish what you wanted EX#1 to accomplish?