[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String Concatenation




> o concatenation with the character constant 0X is equivalent to
>   concatenation with the empty string ""; this means one cannot build
>   a string constant with an embedded 0X character

It is occasionally useful to be able to build strings with embedded 0X
characters. In Win32 lists of strings are often represented using 0X as a
separator. An additional 0X terminates the entire list.

For example, to define a list of filters for a file requester dialog, one
specifies a string that contains a list of pairs of strings. In C, the
strings can be easily separated by embedded 0X characters:

  "Oberon-2 Files\0*.mod\0LaTeX Files\0*.tex;*.bib\0"

Admittedly, this is an unusual use of string constants and I wouldn't be
too concerned about it. Otherwise, the string concatenation looks fine to me.

- Stewart