Sunday, August 2, 2009

What is the code for finding number of charecter present in the string using function in C?

In C.


Using function.

What is the code for finding number of charecter present in the string using function in C?
use strlen() function..


for example:





#include%26lt;stdio.h%26gt;


#include%26lt;string.h%26gt;


main()


{


char str[100];


printf("Enter A String:");


scanf("%s",str);


printf("Length Of Str=%d",strlen(str));


}
Reply:strlen("SomeString")





you need to declare string.h header


No comments:

Post a Comment