C Standard Libraries C++

strlen()

Declaration

size_t strlen(const char* kcpString);

Description

This function returns the length of the null-terminated string "kcpString."

Example

#include <cstdio>
#include <cstring>

int main()
{
    char caString[] = "XoaX.net";
    // Get the length of the string
    int iLength = strlen(caString);
    printf("The length of %s is %i\n", caString, iLength);

    return 0;
}

Output

strlen() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.