The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

wcsncpy - copy part of a wide-character string

 SYNOPSIS



#include <wchar.h>

wchar_t *wcsncpy(wchar_t *ws1, const wchar_t *ws2, size_t n);

 DESCRIPTION

The wcsncpy() function copies not more than n wide-character codes (wide-character codes that follow a null wide-character code are not copied) from the array pointed to by ws2 to the array pointed to by ws1. If copying takes place between objects that overlap, the behaviour is undefined.

If the array pointed to by ws2 is a wide-character string that is shorter than n wide-character codes, null wide-character codes are appended to the copy in the array pointed to by ws1, until n wide-character codes in all are written.

 RETURN VALUE

The wcsncpy() function returns ws1; no return value is reserved to indicate an error.

 ERRORS

No errors are defined.

 EXAMPLES

None.

 APPLICATION USAGE

Wide-character code movement is performed differently in different implementations. Thus overlapping moves may yield surprises.

If there is no null wide-character code in the first n wide-character codes of the array pointed to by ws2, the result will not be null-terminated.

 FUTURE DIRECTIONS

None.

 SEE ALSO

wcscpy(), <wchar.h>.

DERIVATION

Derived from the MSE working draft.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]