in reply to Re^2: (FoxUni) Re: Explanation of complicated line?
in thread Explanation of complicated line?

Um, no. At least on gcc 2.9.3:

char* foo = "This\ is\ rather\ tedious";

produces the string "Thisisrathertedious", and:

char* foo = "This is rather poetic";

produces what you're getting from your Perl example.

Don't knock C for the wrong reasons.

--
:wq

Replies are listed 'Best First'.
Re^4: Explanation of complicated line?
by tadman (Prior) on Apr 02, 2002 at 23:16 UTC
    I'm sure it's a historical artifact more than a requirement, especially considering how some improvements made to C++ are trickling back into C (i.e. '//'-style comments) if only because of popular demand. The "correct" C example, using backslashes, is reasonably:
    char *foo = "This\n\ Is\n\ Rather\n\ Tedious";
    I suppose that earlier and/or less robust C compilers would not comprehend the concept of a string being continued onto a second line.

    I'm sorry if you mistook my unfortunate "ignorance" as being anti-C. I meant nothing of the sort. I'm rather a fan of C++.