tmi*_*hty 1 c++ unicode unicode-escapes
我想创建一个包含所有可能的特殊字符的字符串.
但是,编译器在此行中给出了警告"无法识别的转义序列":
wstring s=L".,;*:-_?#‘?‡…–«»¤¤¡=„+-¶~´:?\¯/??!¡-¢–”¥—†¿»¤{}«[-]()·^°$§%&«|?<´>²³£€™?@©®~µ´`'" + wstring(1,34);
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我,我可能没有按照我的方式添加哪个字符?
非常感谢你!
你必须转义\为\\,否则\¯将被解释为(无效)转义序列:
wstring s=L".,;*:-_?#‘?‡…–«»¤¤¡=„+-¶~´:?\\¯/??!¡-¢–”¥—†¿»¤{}«[-]()·^°$§%&«|?<´>²³£€™?@©®~µ´`'" + wstring(1,34);
Run Code Online (Sandbox Code Playgroud)