Last active
February 22, 2017 23:37
-
-
Save chuck0523/d4ca5fabb1497b7aac2d2be3b760559e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string S = "パタトクカシーー" | |
cout << S[0] // "パ"ではなく文字化けが表示される | |
// 3バイト分取得すればOKだった | |
size_t one_char = 3; | |
cout << S.substr(0, one_char); // "パ" | |
// パトカー抽出 | |
for(int i = 0; i < one_char * 4; i++) { | |
cout << S.substr(i * one_char * 2, one_char); // パトカー | |
} | |
cout << endl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment