【发布时间】:2014-08-22 16:42:57
【问题描述】:
转义字符的行为是否依赖于编译器?
std::string pattern = "\xDDAF5742"; // or do pattern("\xDDAF5742");
std::cout << pattern << " " << pattern.size() << "\n";
在我的系统上,这会输出 B 1 ('B' == 0x42),但我认为它应该将 4 个字符放入字符串中。
【问题讨论】:
标签: c++ string escaping hex std