User Tools

Site Tools


c:stdlib.h:mbtowc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:stdlib.h:mbtowc [2013/01/22 22:02]
127.0.0.1 external edit
c:stdlib.h:mbtowc [2024/02/16 01:04] (current)
Line 27: Line 27:
   wchar_t wchar;   wchar_t wchar;
   char string[] = "mbtowc: 測試字符串";   char string[] = "mbtowc: 測試字符串";
-  int i=0, lenght=0;+  int i=0, length=0;
  
   setlocale(LC_ALL,"");     setlocale(LC_ALL,"");  
-  while ( ( lenght = mbtowc ( &wchar, &string[i], MB_CUR_MAX )) != 0)+  while ( ( length = mbtowc ( &wchar, &string[i], MB_CUR_MAX )) != 0)
     {     {
       printf( "%lc", (wint_t)wchar );       printf( "%lc", (wint_t)wchar );
-      //  printf("i=%i, lenght=%i\n",i, lenght); +      //  printf("i=%i, length=%i\n",i, length); 
-      i += lenght;+      i += length;
     }     }
   printf("\n");   printf("\n");

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
c/stdlib.h/mbtowc.txt · Last modified: 2024/02/16 01:04 (external edit)

Impressum Datenschutz