#include <stdio.h> int strlen(char *src );
The strlen function calculates the length, in bytes, of src. This calculation does not include the null terminating character.
The strlen function returns the length of src.
#include <stdio.h> int main() { char string1[20]; char string2[20]; strcpy(string1, "Learn"); strcpy(string2, "NewFile.oo"); printf("Length of string1 : %d\n", strlen( string1 )); printf("Length of string2 : %d\n", strlen( string2 )); return 0; }
Output Will Be :
Length of string1 : 5 Length of string2 : 7
Your Query was successfully sent!