English
Language : 

CC78K0S Datasheet, PDF (236/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
6-3 strcat
strncat
Character String/Memory Functions
FUNCTION
The string function strcat concatenates one character string to another.
The string function strncat concatenates up to a specified number of characters from one character string to
another.
HEADER
string.h
FUNCTION PROTOTYPE
char *strcat (char *s1, const char *s2);
char *strncat (char *s1, const char *s2, size_t n);
Function
strcat,
strncat
Arguments
s1... Pointer to a string to
which a copy of another string
(s2) is to be concatenated
s2 ... Pointer to a string, copy
of which is to be concatenated
to another string (s1).
n ... Number of characters to
be concatenated
Return Value
Value of s1
EXPLANATION
strcat
• The strcat function concatenates a copy of the string pointed to by s2 (including the null terminator) to the
string pointed to by s1. The null terminator originally ending s1 is overwritten by the first character of s2.
• When copying is performed between objects overlapping each other, the operation is not guaranteed.
strncat
• The strncat function concatenates not more than the characters specified by n of the string pointed to by s2
(excluding the null terminator) to the string pointed to by s1. The null terminator originally ending s1 is
overwritten by the first character of s2.
• If the string pointed to by s2 has fewer characters than specified by n, the strncat function concatenates the
string including the null terminator. If there are more characters than specified by n, the n character section is
concatenated starting from the top.
• The null terminator must always be concatenated.
• When copying is performed between objects overlapping each other, the operation is not guaranteed.
236
User’s Manual U14872EJ1V0UM