User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







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

btowc

   #include <wchar.h>
   wint_t btowc(int);

Description

convert a byte to wide character btowc returns the wide two byte character “wchar_t” converted from the single byte “string” character (char).

return value

If the argument is not a valid multibyte sequence of length 1 btowc returns WEOF.
output is affected by the current LC_TYPE locale.

btowc C Sourcecode Example

/* 
 * btowc example code
 * http://code-reference.com/c/wchar.h/btowc
 */
 
#include <stdio.h>
#include <wchar.h>
 
int main( void ) {
 
    char string[] = "btowc \x65xampl\x65";
    int i;
 
    for ( i = 0; i < 13; ++i) {
        printf("%c %c\n", string[i], (wchar_t)btowc(string[i]) );
    }
    return 0;
}

output

  b b
  t t
  o o
  w w
  c c
     
  e e
  x x
  a a
  m m
  p p
  l l
  e e
advertising
c/wchar.h/btowc.txt · Last modified: 2013/01/22 22:02 (external edit)

Impressum