Escape sequence for ? in 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. 回答1: It's to keep a question mark from getting misinterpreted as part of a trigraph. For example, in "What??!" The "??! would be interpreted as the | character. So, you have to escape the question marks as follows: "What\?\?!" Example complements