Keil Logo


#include <string.h>

unsigned int strlen (
  const unsigned char *src);   /* source string */

The strlen function calculates the length, in bytes, of src. This calculation does not include the null terminating character.

Return Value

The strlen function returns the length of src.

See Also

strcat, strncat, strncpy

#include <string.h>
#include <stdio.h> /* for printf */

void tst_strlen (void) {
  unsigned char buf [] = "Find the length of this string";
  unsigned int len;

  len = strlen (buf);
  printf ("string length is %d\n", len);
  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.