beautypg.com

Strlen function, Strncat function – Zilog Z80380 User Manual

Page 81

background image

UM004001-COR1103

4–17

Run Time Environment

Library Functions

strlen

FUNCTION

Header file statement:

#include

Syntax:

size_t strlen

(const char *string);

The strlen function returns the length, in bytes, of string, not including the terminating null
character (‘\0’).

Return Value

This function returns the string length. There is no error returned.

strncat

FUNCTION

Header file statement:

#include

Syntax:

char *strncat

(char *string1, const char *string2, size_t count);

The strncat function appends, at most, the first count characters of string2 to string1, termi-
nate the resulting string with a null character (‘\0’), and return a pointer to the concatenated
string (string1). If count is greater than the length of string2, the length of string2 is used in
place of count.

Return Value

The return values for these functions are described above.

Parameter

Description

string

Null-terminated string

Parameter

Description

string1

Destination string

string2

Source string

count

Number of characters appended