wcsncat


wcsncat

Appends a number of wide characters from one string to another

 #include <wchar.h> wchar_t *wcsncat ( wchar_t * restrict s1 , const wchar_t * restrict s2 ,                   size_t n  ); 

The wcsncat( ) function copies up to n wide characters of the string addressed by the second pointer argument, s2, to the location following the wide string addressed by the first pointer, s1. The first wide character of s2 is copied over the null wide character that terminates the string addressed by s1. The function returns the value of its first argument, which points to the resulting string. The locations that wcsncat( ) reads from and writes to must not overlap.

Unlike wcscat( ), wcsncat( ) has a third parameter, n, to limit the length of the string written. The wcsncat( ) function stops copying when it has copied n characters, or when it reaches a terminating null character in the source string, whichever occurs first. In either case, wcsncat( ) appends a null character to the concatenated string addressed by s1. The string's length thus increases by at most n wide characters.

Example

See the example for wcscspn( ) in this chapter.

See Also

wcscat( ), strncat( ), strcat( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net