Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
UTF-8 in C++11
#include <codecvt> #include <locale> #include <iostream> #include <iomanip> int main() { using namespace std; locale wcin_loc{wcin.getloc(), new codecvt_utf8<wchar_t>{}}; wcin.imbue(wcin_loc); locale wcout_loc{wcout.getloc(), new codecvt_utf8<wchar_t>{}}; wcout.imbue(wcout_loc); wcout << "Len Word" << endl; wcout << "=== ====" << endl; for (wstring str; wcin >> str; ) { wcout << setw(3) << str.length() << " " << str << endl; } }
run
|
edit
|
history
|
help
0
nontype template parameter produced with decltype for function
constructor-is-not-called-in-this-aggregation-class
Делим на Ноль
Template Meta Programming
<string> No indirect include of <errno.h>
Linker error while taking the address of a constexpr variable
ECE2574_Function_Calling_Example
Assertion Divide by Zero Example
Balanced Insert Example
list iota cout