我想知道如何避免反斜杠和双引号转义它的表达式。将使用R()
与LPCSTR一起工作?C++避免反斜杠和双引号转义
反斜杠:
WriteKey("\"); //this will escaped accidentally.
WriteKey("/"); //this wouldn't
同双引号:
WriteKey("""); //this would escape too
WriteKey("'"); //but not this
注:WriteKey()
需要LPCSTR
它使用R()
工作,LPCSTR的说法
你使用什么编译器? –
'主流'IDE:Visual Studio –
原始字符串就像普通的字符串文字一样正常的字符串文字(例如'“foobar”'),不同之处在于您不必转义某些字符。 –