We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f73e9f6 commit 0b61755Copy full SHA for 0b61755
1 file changed
reference/cstdlib/mblen.md
@@ -51,7 +51,6 @@ int main() {
51
#include <clocale>
52
53
int count_chars_mblen(const char* s) {
54
- std::setlocale(LC_ALL, "ja_JP.UTF-8");
55
int count = 0;
56
size_t i = 0;
57
while (s[i] != '\0') {
@@ -66,6 +65,8 @@ int count_chars_mblen(const char* s) {
66
65
}
67
68
int main() {
+ std::setlocale(LC_ALL, "ja_JP.UTF-8");
69
+
70
const char* str = "こんにちは世界";
71
std::cout << "文字列: " << str << "\n";
72
std::cout << "文字数: " << count_chars_mblen(str) << "\n";
0 commit comments