Skip to content

Instantly share code, notes, and snippets.

@truongan
Last active December 21, 2017 07:00
Show Gist options
  • Save truongan/cd9a7e9a0401e8447e9064df588cc378 to your computer and use it in GitHub Desktop.
Save truongan/cd9a7e9a0401e8447e9064df588cc378 to your computer and use it in GitHub Desktop.
How to write a wchar literal in C++ and output its binary representation
#include <iostream>
#include <bitset>
using namespace std;
int main()
{
wchar_t A[] = L"bỏ dấu cho đúng chính tả em ơi";
for(auto x : A){
cout << bitset<16>( x ) << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment