Re: Unrecognized escape sequences in string literals
- From: Douglas Alan <darkwater42@xxxxxxxxx>
- Date: Tue, 11 Aug 2009 13:20:52 -0700 (PDT)
On Aug 11, 2:00 pm, Steven D'Aprano <st...@REMOVE-THIS-
cybersource.com.au> wrote:
test.cpp:1:1: warning: unknown escape sequence '\y'
Isn't that a warning, not a fatal error? So what does temp contain?
My "Annotated C++ Reference Manual" is packed, and surprisingly in
Stroustrup's Third Edition, there is no mention of the issue in the
entire 1,000 pages. But Microsoft to the rescue:
If you want a backslash character to appear within a string,
you must type two backslashes (\\)
(From http://msdn.microsoft.com/en-us/library/69ze775t.aspx)
The question of what any specific C++ does if you ignore the warning
is irrelevant, as such behavior in C++ is almost *always* undefined.
Hence the warning.
|>ouglas
.
- Follow-Ups:
- Re: Unrecognized escape sequences in string literals
- From: Steven D'Aprano
- Re: Unrecognized escape sequences in string literals
- From: Ethan Furman
- Re: Unrecognized escape sequences in string literals
- References:
- Unrecognized escape sequences in string literals
- From: Douglas Alan
- Re: Unrecognized escape sequences in string literals
- From: Steven D'Aprano
- Re: Unrecognized escape sequences in string literals
- From: Douglas Alan
- Re: Unrecognized escape sequences in string literals
- From: Steven D'Aprano
- Re: Unrecognized escape sequences in string literals
- From: Douglas Alan
- Re: Unrecognized escape sequences in string literals
- From: Steven D'Aprano
- Re: Unrecognized escape sequences in string literals
- From: Douglas Alan
- Re: Unrecognized escape sequences in string literals
- From: Steven D'Aprano
- Re: Unrecognized escape sequences in string literals
- From: Piet van Oostrum
- Re: Unrecognized escape sequences in string literals
- From: Steven D'Aprano
- Unrecognized escape sequences in string literals
- Prev by Date: Re: ElementTree - Howto access text within XML tag element...
- Next by Date: Re: ElementTree - Howto access text within XML tag element...
- Previous by thread: Re: Unrecognized escape sequences in string literals
- Next by thread: Re: Unrecognized escape sequences in string literals
- Index(es):
Relevant Pages
|