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:
1. When should I use `std::wstring` over `std::string`?
2. Can `std::string` hold the entire ASCII character set, including the special characters?
3. Is `std::wstring` supported by all popular C++ compilers?
4. What is exactly a "*wide character*"?
Use std::wstring over std::string when you need to work with wide characters or Unicode characters, examples being when you're dealing with localization in your program.
Yes, it can hold the entire ASCII character set including special characters, as long as they're supported by the encoding being used.
std::wstring being a part of the standard library allows it to be supported by many popular C++ compilers.
"wide characters" are characters represented by more than a single byte, usually 2 or 4 bytes.