Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 User Manual
Product codes
SW006021-1
Library Functions
2012 Microchip Technology Inc.
DS52053B-page 361
STRCAT
Synopsis
#include <string.h>
char * strcat (char * s1, const char * s2)
Description
This function appends (concatenates) string
s2
to the end of string
s1
. The result will
be null terminated. The argument
s1
must point to a character array big enough to hold
the resultant string.
Example
#include <string.h>
#include <stdio.h>
void
main (void)
{
char buffer[256];
char * s1, * s2;
strcpy(buffer, "Start of line");
s1 = buffer;
s2 = "... end of line";
strcat(s1, s2);
printf("Length = %d\n", strlen(buffer));
printf("string = \"%s\"\n", buffer);
}
See Also
strcpy()
, strcmp(), strncat(), strlen()
Return Value
The value of
s1
is returned.
STRCHR, STRICHR
Synopsis
#include <string.h>
char * strchr (const char * s, int c)
char * strichr (const char * s, int c)
Description
The
strchr()
function searches the string
s
for an occurrence of the character
c
. If
one is found, a pointer to that character is returned, otherwise NULL is returned.
The
strichr()
function is the case-insensitive version of this function.