I am not able to understand the differences between std::string and std::wstring. I know wstring supports wide characters such as Unicode characters. I have got the following questions:
- When should I use
std::wstringoverstd::string? - Can
std::stringhold the entire ASCII character set, including the special characters? - Is
std::wstringsupported by all popular C++ compilers? - What is exactly a "wide character"?
12 Answers
string? wstring?
std::string is a basic_string templated on a char, and std::wstring on a wchar_t.