Created
March 17, 2015 12:48
-
-
Save CN6033/774944b0c136ef0e815c to your computer and use it in GitHub Desktop.
How strlen() function works.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size_t strlen(char const * s) | |
{ | |
size_t len = 0; | |
while(*s++) { | |
len++; | |
} | |
return len; | |
} | |
/* | |
"\0" is a character, the null character with ASCII value 0. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment