wctob - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# wctob

From cppreference.com
< c‎ | string‎ | multibyte

Defined in header `<wchar.h>` |  |
int wctob( wint_t c ); |  |

Narrows a wide character `c` if its multibyte character equivalent in the initial shift state is a single byte.

This is typically possible for the characters from the ASCII character set, since most multibyte encodings (such as UTF-8) use single bytes to encode those characters.

### [edit] Parameters

c | - | wide character to narrow

### [edit] Return value

EOF if `c` does not represent a multibyte character with length 1 in initial shift state.

otherwise, the single-byte representation of `c` as unsigned char converted to int

### [edit] Example

| This section is incomplete Reason: no example

### [edit] See also

btowc | widens a single-byte narrow character to wide character, if possible (function) [edit]
C++ documentation for wctob

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/string/multibyte/wctob&oldid=56811"
Category:

- Todo no example