Nov 15, 2015 Problem:-Write A C Program To Find The Length Of Any String or How to Find the length of String In C and C? Or C Program to Find Length of String Without Using Library Function or C program to find Length of String or C Program to Find the Length of a String or C program to Find Length of String without using strlen or calculate length of a string without using standard library. C provides following two types of string representations − The C-style character string. The string class type introduced with Standard C. The C-Style Character String. The C-style character string originated within the C language and continues to be supported within C.
- The C Standard Library
- C Standard Library Resources
Php Strlen Function
- C Programming Resources
- Selected Reading
Description
Strlen Vs Sizeof
The C library function size_t strlen(const char *str) computes the length of the string str up to, but not including the terminating null character.
Declaration
Following is the declaration for strlen() function.
Parameters
- str − This is the string whose length is to be found.
Sizeof Function In C
Return Value
This function returns the length of string.
Example
The following example shows the usage of strlen() function.
Let us compile and run the above program that will produce the following result −
string_h.htm