strlen

 

Description

Get the length of a string in bytes(not including the terminating null character).

Syntax

int strlen( LPCSTR lpString )

Parameters

lpString
[input] Pointer to a null-terminated string.

Return

the length of the string (not including zero termination).

Examples

EX1

void strlen_ex1()
{
    string        str1 = "Hello World!";    
    int            len = strlen(str1);    // len is 12 (the length of str1).
    out_int("The length is ", len);
}

Remark

See Also

header to Include

origin.h

Reference