的转义序列?在 c++
我正在查看 C++ 中字符串中字符的转义序列,我注意到问号有一个转义序列。有人能告诉我这是为什么吗?这看起来有点奇怪,我不明白是什么?在字符串中执行。谢谢。
I was looking at the escape sequences for characters in strings in c++ and I noticed there is an escape sequence for a question mark. Can someone tell me why this is? It just seems a little odd and I can't figure out what ? does in a string. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是为了防止问号被误解为三字母组的一部分。
例如,在
“??!”中,将被解释为
|
字符。因此,您必须按如下方式转义问号:http://msdn.microsoft.com/en-us/library/bt0y4awe%28VS.80%29。 ASPX
It's to keep a question mark from getting misinterpreted as part of a trigraph.
For example, in
The "??! would be interpreted as the
|
character. So, you have to escape the question marks as follows:Example complements of http://msdn.microsoft.com/en-us/library/bt0y4awe%28VS.80%29.aspx