3.2.32. strcat

Concatenates two strings.


char *strcat (dest, src)
char *dest;
char *src;



A character pointer, that specifies the starting address for the destination memory area. Characters from the src string are appended to the end of this string, starting where the NUL character previously terminated the string.


A character pointer that specifies the starting address for the source memory area, to begin copying characters from, when appending to the end of the *dest string.


This macro appends the src string to the end of the dest string, and then returns a pointer to the dest string. This macro behaves like the strcat function in the ANSI C string library.

Return value

char *

A pointer to the first byte in the dest string.


This macro does not check to see whether the second string can fit in the first array, unless it is a debugger array. Failure to allot enough space for the first array causes excess characters to overflow into adjacent memory locations. Consider using the strlen macro first to confirm that there is enough length in dest, for the original dest and src together.


This example shows how to use strcat on the command line:

> add char buff[15]
> ce strcpy(buff,"12345")
  Result is: local address 0x10000
> ce strcat(buff,"67890")
  Result is: local address 0x10000
> printf "%s\n",buff

See Also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N