Guardian C Library Calls Reference Manual

strcat
3-192 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
strcat
The strcat function concatenates two strings.
str1_ptr
points to the string to which the second string is concatenated.
str2_ptr
points to the string that is concatenated to the first string.
Return Value
points to the resulting string.
Usage Guidelines
The strcat function assumes that *str1_ptr can accommodate both *str1_ptr and
*str2_ptr.
The strcat function appends a null character to the result.
Example
This example concatenates s2 to the end of s1 and prints “Hi Paula!”:
#include <stringh>
#include <stdioh>
int main(void)
{
char s1[20];
char *s2;
s1[0] = 'H';
s1[1] = 'i';
s1[2] = ' ';
s1[3] = '\0'; /* NULL */
s2 = "Paula!\n";
strcat(s1,s2);
printf("%s",s1);
}
#include <stringh>
char *strcat(char *str1_ptr, const char *str2_ptr);