LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

strncat

char *strncat (char targetString[], const char stringToAppend[], size_t maxChars);

Purpose

Appends a specified number of characters from a source string to the end of a target string. Any characters beyond the first ASCII NUL byte in the source string are not appended. The initial character of the source string overwrites the NUL byte at the end of the target string. An ASCII NUL is appended to the end of the target string, unlike with strncpy. 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.

Parameters

Input
Name Type Description
stringToAppend const char [] Contains a pointer to the NUL-terminated string from which a specified number of characters, not including a final NUL byte, are appended to the end of targetString. The initial character of this string overwrites the NUL byte at the end of the target string.
maxChars size_t Specifies the maximum number of characters that are appended from the source string to the target string. The number does not include the ASCII NUL byte that is appended to the target string.
Output
Name Type Description
targetString char [] Contains the target string to which a specified number of characters from string_toAppend are 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 appended at the end of the target string. 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 3.0 and later

Was this information helpful?

Previous

strlen

Previous

strlen

Log in to get a better experience

Help us improve your future ni.com experience.

What are you trying to do?

Submit