Created
April 22, 2025 19:12
-
-
Save elsl3/9dfcac9082c0193c335b65a26905ce8e 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
#include <stdio.h> | |
#include <uchar.h> | |
int main(void) { | |
char16_t c16 = u'あ'; // UTF-16文字リテラル | |
char32_t c32 = U'𠮷'; // UTF-32文字リテラル(サロゲートペアを含む文字) | |
printf("char16_tのサイズ: %zu バイト\n", sizeof(c16)); | |
printf("char32_tのサイズ: %zu バイト\n", sizeof(c32)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment