Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

questionable escape sequences

39 views
Skip to first unread message

Christopher Pisz

unread,
Dec 3, 2014, 11:54:29 AM12/3/14
to
Why is there an escape sequence for single quote and question mark?
I don't recall ever having a problem with std::string text = "How are
you?"; or std::string text = "He likes 'adventure'";

red floyd

unread,
Dec 3, 2014, 12:01:29 PM12/3/14
to
single quote:

char c = '\'';

As for question mark? I suspect it has to do with trigraphs, but
I don't know for sure.



Victor Bazarov

unread,
Dec 3, 2014, 12:04:01 PM12/3/14
to
Try declaring a single char and initializing it with a *single quote*
without an escape sequence... The question mark rule may have something
to do with trigraph sequences.

V
--
I do not respond to top-posted replies, please don't ask

red floyd

unread,
Dec 3, 2014, 3:24:40 PM12/3/14
to
On 12/3/2014 9:03 AM, Victor Bazarov wrote:
> On 12/3/2014 11:54 AM, Christopher Pisz wrote:
>> Why is there an escape sequence for single quote and question mark?
>> I don't recall ever having a problem with std::string text = "How are
>> you?"; or std::string text = "He likes 'adventure'";
>
> Try declaring a single char and initializing it with a *single quote*
> without an escape sequence... The question mark rule may have something
> to do with trigraph sequences.
>

GMTA, Victor!


Victor Bazarov

unread,
Dec 3, 2014, 3:32:13 PM12/3/14
to
Exactly what I thought, too. It's recursive! ;-)
0 new messages