User Tools

Site Tools


c:stdlib.h:mbtowc
click
to support this page (eg 0,42 € or so) Thanks.

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 [2014/06/27 15:56] (current)
213.190.87.194 [mbtowc C Sourcecode Example] corrected a typo (lenght -> length)
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");
advertising
c/stdlib.h/mbtowc.txt · Last modified: 2014/06/27 15:56 by 213.190.87.194

Impressum