_mbsnbcat
- Updated2023-02-21
- 2 minute(s) read
_mbsnbcat
char *_mbsnbcat (char targetString[], const char stringToAppend[], size_t maxBytes);
Purpose
Appends a specified number of bytes from a source string to the end of a target string. The function does not append characters to the target string beyond the first ASCII NUL byte in the source string. The initial character of the source string overwrites the final NUL byte of the target string. _mbsnbcat appends an ASCII NUL byte to the end of the target string, unlike _mbsnbcpy. Although the NUL byte is not included in specified number of bytes, the target buffer must be large enough to hold this extra byte. If copying takes place between objects that overlap, the behavior is undefined.
Refer to the Programming for Multibyte Character Sets in LabWindows/CVI topic for information about working with multibyte character sets.
Parameters
Input | ||
Name | Type | Description |
stringToAppend | const char [] | Contains a pointer to the NUL-terminated string from which a specified number of bytes is appended to the end of targetString. However, if a NUL byte is encountered before reaching that specified number, the appending of characters stops. The initial character of this string overwrites the NUL byte at the end of the target string. |
maxBytes | size_t | Specifies the maximum number of bytes appended from the source string to the target string. If part of a multibyte character lies beyond this number, that multibyte character is not appended. The number does not include the ASCII NUL byte that is always appended to the target string. |
Output | ||
Name | Type | Description |
targetString | char [] | Contains the target string to which a specified number of bytes from string_toAppend is appended. The initial character of string_toAppend overwrites the NUL byte at the end of the string specified in this parameter. An ASCII NUL byte is always appended at the end of the target string. Although the NUL byte is not included in specified number of bytes, the target buffer must be large enough to hold this extra byte. |
Return Value
Name | Type | Description |
returnedTargetString | char * | Contains a pointer to the modified target string. |
Additional Information
Library: ANSI C Library
Include file: ansi_c.h
LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later