Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!mcnc!xanth!kyle From: kyle@xanth.UUCP (Kyle Jones) Newsgroups: comp.lang.c Subject: Re: newlines in string constants Message-ID: <2810@xanth.UUCP> Date: Fri, 16-Oct-87 20:49:23 EDT Article-I.D.: xanth.2810 Posted: Fri Oct 16 20:49:23 1987 Date-Received: Sun, 18-Oct-87 08:26:06 EDT References: <2669@xanth.UUCP> <15262@clyde.ATT.COM> Lines: 33 Summary: the net says "forget it", but why? In article <2669@xanth.UUCP>, I state that I would like to see multi-line strings like: char *s = "This is not legal."; to become legal under ANSI C. In article <15262@clyde.ATT.COM>, feg@clyde.ATT.COM (Forrest Gehrke) writes: > How is the compiler going to divine the number (if any) of spaces you > will want? The intervening spaces might have been intentional. Exactly. I want the compiler to take everything that appears between the double quotes literally, with the exception of the usual backslash escapes. My text editor knows how many spaces there are after "is", so the compiler certainly shouldn't have any problem grasping this. All the responses I received said that multi-line strings are still illegal under ANSI C but pointed out that strings separated by only by whitespace will be concatenated. Furthermore, the responses I received indicated that literal newlines in strings are disallowed so the compiler can discover unterminated strings early and not see the rest of the program "inside-out". There has GOT to be a better explanation than that. Yes, the compiler would lose its mind if you forgot a " but not any more so than when you forget a brace or put a semicolon after a function definition. I can write a pre-processer that allows me to have my multi-line strings, but I would like to believe there's a better reason than the one above for not allowing them in the language. kyle jones old dominion university, norfolk, va usa