C++ inserting wchar_t backslash into string
问题 I have a wide char literal: const wchar_t* charSet = L" !\"#$%&'()*+,-./0123456789:;<=>?\n" L"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\n" L"`abcdefghijklmnopqrstuvwxyz{|}~\n"; When I pass it into text processor '\'(backslash) isn't there.Now if I put instead \\ it I am getting compile time error: "missing closing quote" So how do I put backslash into such a char string? 回答1: As for your original code L" !\"#$%&'()*+,-./0123456789:;<=>?\n" you simply missed escaping the quote character " again.