BUY TELUGU TUTORIAL DVD'S:::: SEO::3500/-,DCA(DOS,WINDOWS,WORD,EXCEL,POWER POINT, MS ACCESS, INTERNET CONCEPTS)::499/-,DTP(PHOTOSHOP,PAGEMAKER, CORELDRAW,TELUGU TYPING)::999/-,C::700,C++::900,TALLY ERP 9:: 999,ORACLE:999/-,CORE JAVA::1000/-,SPOKEN HINDI:500,HTML::500/-,AUTOCAD::2500/-,DCA+DTP::1000/-,DCA+TALLY::1000,C,C++,JAVA::1500, ALL COURSES(DCA,DTP,C,C++,JAVA,ORACLE,TALLY,HTML,SPOKEN HINDI,AUTOCAD):: 3500/-..CONTACT : SYED HAFIZ, SHOPPING COMPLEX,8INCLINE COLONY,GODAVARI KHANI,KARIMNAGAR, TELANGANA,CELL:9395306603,EMAIL:COOLHAFI7@GMAIL.COM.
Home / C / C language tutorial in telugu free download Part 35

C language tutorial in telugu free download Part 35

C language tutorial in telugu free download

Description

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.

size_t strlen(const char *str)

Parameters

  • str — This is the string whose length is to be found.

Return Value

This function returns the length of string.

Example

The following example shows the usage of strlen() function.

#include <stdio.h>
#include <string.h>

int main ()
{
   char str[50];
   int len;

   strcpy(str, "This is tutorialspoint.com");

   len = strlen(str);
   printf("Length of |%s| is |%d|n", str, len);

   return(0);
}

Let us compile and run the above program, this will produce the following result:

Length of |This is tutorialspoint.com| is |26|

Explanation of Program :

In the above program we have accepted the string from the user.

After that we have initialized the length variable with zero. “length” variable is used to keep track of the number of character accessed.
Initially length is 0. Now we are accessing very first character. If it is equal to NULL then we are terminating the loop else we are incrementing the length.

About Hafiz

Check Also

C language tutorial in telugu free download Part 32

c language tutorial in telugu free download getch in c getch in c language: getch …

Leave a Reply

Your email address will not be published. Required fields are marked *

STATE BANK OF HYDERABAD, ***NAME:Hafiz SD, BRANCH:JALLARAM, ACCOUNT.NO:62041435239, IFSC CODE:SBHY0020609,****, ANDRA BANK*** NAME:SYED HAFEEZ BABA, BRANCH:8INCLINE COLONY, ACCOUNT.NO:116710100037533****SBI****NAME:SYED HAFEEZ BABA,ACCOUNT NO:35321924009,IFSC CODE:SBIN0013338,BRANCH:GODAVARIKHANI.,...