[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2.9 Concatenated Strings

If single or double quote characters are used, then you also have the option, a la ANSI-C syntax, of implicitly concatenating a series of them together, with intervening white space ignored.

NB You cannot use directives to alter the string content. That is,

 
str = "foo"
#ifdef LATER
      "bar"
#endif
      ;

will result in a syntax error. The preprocessing directives are not carried out by the C preprocessor. However,

 
str = '"foo\n"
#ifdef LATER
"     bar\n"
#endif
';

Will work. It will enclose the `#ifdef LATER' and `#endif' in the string. But it may also wreak havoc with the definition processing directives. The hash characters in the first column should be disambiguated with an escape \ or join them with previous lines: "foo\n#ifdef LATER....



This document was generated by Bruce Korb on February, 4 2002 using texi2html