Keil Logo

strncat

Summary
#include <string.h>

char *strncat (
  unsigned char *dst,        /* destination string */
  const unsigned char *src,  /* source string */
  unsigned int len);         /* max. chars to concatenate */
Description

The strncat function appends at most len characters from src to dst and terminates dst with a null character. If src has fewer than len characters, src is copied up to and including the null terminating character.

Return Value

The strncat function returns dst.

See Also

strcat, strcpy, strlen, strncpy

Example
#include <string.h>

void tst_strncat (void) {
  unsigned char buf [21];

  strcpy (buf, "test #");
  strncat (buf, "three", sizeof (buf) - strlen (buf));
}
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.