C Programming on the IBM PC (C Programmers Reference Guide Series)

The Wide-Character String Functions

There are wide-character versions of the string manipulation functions described in Chapter 7. These are shown in the following table. They use the header <wchar.h>. Note that wcstok( ) requires an additional parameter not used by its char equivalent.

Function

char Equivalent

wchar_t *wcscat(wchar_t *str1, const                              wchar_t *str2)

strcat( )In C99, str1 and str2 are qualified by restrict.

wchar_t *wcschr(const wchar_t *str,                              wchar_t ch)

strchr( )

int wcscmp(const wchar_t *str1,                     const wchar_t *str2)

strcmp( )

int wcscoll(const wchar_t *str1,                    const wchar_t *str2)

strcoll( )

size_t wcscspn(const wchar_t *str1,                           const wchar_t *str2)

strcspn( )

wchar_t *wcscpy(wchar_t *str1,                               const wchar_t *str2)

strcpy( )In C99, str1 and str2 are qualified by restrict.

size_t wcslen(const wchar_t *str)

strlen( )

wchar_t *wcsncpy(wchar_t *str1,                                 const wchar_t str2,                                 size_t num)

strncpy( )In C99, str1 and str2 are qualified by restrict.

wchar_t *wcsncat(wchar_t *str1,                                const wchar_t str2,                                size_t num)

strncat( )In C99, str1 and str2 are qualified by restrict.

int wcsncmp(const wchar_t *str1,                       const wchar_t *str2, size_t num)

strncmp( )

wchar_t *wcspbrk(const wchar_t *str1,                                const wchar_t *str2)

strpbrk( )

wchar_t *wcsrchr(const wchar_t *str,                                wchar_t ch)

strrchr( )

size_t wcsspn(const wchar_t *str1,                         const wchar_t *str2)

strspn( )

wchar_t *wcstok(wchar_t *str1, const                              wchar_t *str2,                              wchar_t **endptr)

strtok( )Here, endptr is a pointer that holds information necessary to continue the tokenizing process.In C99, str1, str2, and endptr are qualified by restrict.

wchar_t *wcsstr(const wchar_t *str1,                             const wchar_t *str2)

strstr( )

size_t wcsxfrm(wchar_t *str1, const                           wchar_t *str2,                           size_t num)

strxfrm( )In C99, str1 and str2 are qualified by restrict.

Категории