Consider this sample program:
#include
#include
#include
int main()
{
std::string narrowstr = \"narrow\";
The answers to 1 and 2 are in the question are in the documentation. Any good set of documentation will do. They say cppreference is very good.
As for 3, the language standard does not specify any particular encoding for strings, or any particular size of wchar_t
. You need to consult the documentation for your implementation, rather than for the language proper (though writing implementation-dependent code is rarely advisable).