Mail Archives: djgpp/1997/11/16/19:01:49
On Sun, 16 Nov 1997 19:34:30 GMT in comp.os.msdos.djgpp Jose Luis Perandones Colino <joepc AT writeme DOT com> wrote:
: I want a constant sting, but the string is very long, can i declare in
: multiple lines???
Of course -- you can either end each line with a backslash like this:
char *string1 = "foo\
bar";
(but you must not indent the `bar' or the indent will be part of the
string), or you can close the double-quotes and reopen them:
char *string2 = "foo"
"bar";
In the latter case you can indent before the quotes. You can put any
whitespace between the closing quotes and the reopening ones.
Needless to say, using either system you can split a string across as
many lines as you like. If you're perverse, you can of course mix the
two systems...
BTW the resulting string in the above two cases is identical to "foobar".
: char text=" ... "
^^^
You missed out the `*', incidentally.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -