Keil Logo

strlcat()

4.36 strlcat()

Defined in string.h, the strlcat() function concatenates two strings.

Syntax

extern size_t strlcat(char *dst, const char *src, size_t size);

Usage

strlcat() appends up to size-strlen(dst)-1 bytes from the NUL-terminated string src to the end of dst. It takes the full size of the buffer, not only the length, and terminates the result with NUL as long as size is greater than 0. Include a byte for the NUL in your size value.
The strlcat() function returns the total length of the string that would have been created if there was unlimited space. This might or might not be equal to the length of the string actually created, depending on whether there was enough space. This means that you can call strlcat() once to find out how much space is required, then allocate it if you do not have enough, and finally call strlcat() a second time to create the required string.
This function is a common BSD-derived extension to many C libraries.
Non-ConfidentialPDF file icon PDF versionARM DUI0378H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  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.