wcwidth()

Updated: April 19, 2023

Determine the number of column positions of a wide character

Synopsis:

#include <wchar.h>

int wcwidth( const wchar_t wc );

Arguments:

wc
The code of the wide character whose width you want to determine

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The wcwidth() function determines the number of column positions required to represent the wide character wc.

Returns:

If wc is a printable wide-character, the value is at least 0. If wc is a NUL-terminating wide-character (L'\0'), the value is 0. Otherwise, -1 is returned.

Classification:

ANSI, POSIX 1003.1

Safety:  
Cancellation point No
Interrupt handler Yes
Signal handler Yes
Thread Yes