|
String length
This example shows using strlen library function.
07 | char *s = "BE THE CODER" ; |
08 | printf ( "\nLength of string (%s) is %d" , s, strlen (s)); |
11 | printf ( "\nLength of string (%s) is %d" , s, strlen (s)); |
14 | printf ( "\nLength of string (%s) is %d" , s, strlen (s)); |
|
It gives the following output,
Length of string (BE THE CODER) is 12
Length of string (123456) is 6
Length of string (123456789) is 9
|
|