fork(1) download
  1. #include <stdio.h>
  2. #include <wchar.h>
  3. #include <string.h>
  4.  
  5. int main(void) {
  6. char32_t* str = L"日本語";
  7. int i;
  8. for (i = 0; i < wcslen(str); i++) {
  9. printf("%lc\n", str[i]);
  10. }
  11. return 0;
  12. }
  13.  
Compilation error #stdin compilation error #stdout 0s 2048KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:6:2: error: unknown type name 'char32_t'
  char32_t* str = L"日本語";
  ^
prog.c:6:18: warning: initialization from incompatible pointer type
  char32_t* str = L"日本語";
                  ^
prog.c:8:25: warning: passing argument 1 of 'wcslen' from incompatible pointer type
  for (i = 0; i < wcslen(str); i++) {
                         ^
In file included from prog.c:2:0:
/usr/include/wchar.h:287:15: note: expected 'const wchar_t *' but argument is of type 'int *'
 extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
               ^
stdout
Standard output is empty