0% found this document useful (0 votes)
16 views

C Library Function - Strlen

Uploaded by

Marcelo Luna
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

C Library Function - Strlen

Uploaded by

Marcelo Luna
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Home Jobs Tools Coding Ground Current Affairs UPSC Notes Online Tutors Whiteboard Tutorix Login

Categories Search latest courses, ebooks and prime packs... Q/A Library eBooks Courses

C library function - strlen()

Previous Page Next Page  

Description
The C Standard Library 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.
C Library - Home

C Library - <assert.h> Declaration


C Library - <ctype.h> Following is the declaration for strlen() function.

C Library - <errno.h> size_t strlen(const char *str)

C Library - <float.h>
Parameters
C Library - <limits.h>
str − This is the string whose length is to be found.
C Library - <locale.h>
We make use of cookies to improve our user experience. By using this website, you agree with our Cookies Policy. Agree Learn more

C Library - <math.h>
Return Value
C Library - <setjmp.h>
This function returns the length of string.
C Library - <signal.h>

C Library - <stdarg.h> Example


C Library - <stddef.h> The following example shows the usage of strlen() function.
C Library - <stdio.h>
Live Demo
C Library - <stdlib.h> #include <stdio.h>
#include <string.h>
C Library - <string.h>

C Library - <time.h> int main () {


char str[50];
C Standard Library Resources int len;

C Library - Quick Guide strcpy(str, "This is tutorialspoint.com");

C Library - Useful Resources


len = strlen(str);
C Library - Discussion printf("Length of |%s| is |%d|\n", str, len);

C Programming Resources return(0);


}
C Programming - Tutorial
Let us compile and run the above program that will produce the following result −
C - Useful Resources

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

UPSC IAS Exams Notes

Developer's Best Practices Useful Video Courses


Questions and Answers
Video Video Video
Effective Resume Writing

HR Interview Questions

Computer Glossary

Who is Who
JCL Online Training COBOL Online Training CRO Online Training

12 Lectures 2 hours 12 Lectures 2.5 hours 48 Lectures 6.5 hours

Nishant Malik Nishant Malik Asif Hussain

More Detail More Detail More Detail

Video Video Video

Customer Service Online Cultivation Of Crops Eclipse Online Training


Training
12 Lectures 2 hours 20 Lectures 3.5 hours 44 Lectures 1 hours

Richa Maheshwari Vandana Annavaram Amit Diwan

More Detail More Detail More Detail

Previous Page Print Page Next Page  

Advertisements

About us Refund Policy Terms of use Privacy Policy FAQ's Contact

© Copyright 2022. All Rights Reserved.

You might also like