Manually Find The Length Of A String | C Programming Example

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Thank you Kevin. It is pleasure to watch all your videos, always.

fifaham
Автор

I love all your videos. But could you pls explain why here we don't use size_t? Thank you very much

elenajiang
Автор

Please how can I implement popleft() in C as in python?

theintelmedia
Автор

Do you recommend making our own function or using the one from the string.h library

nub
Автор

It's difficult to beat the strlen library code for efficiency:
strlen(str)
const char *str;
{
register const char *s;

for (s = str; *s; ++s);
return(s - str);
}

KevinInPhoenix
Автор

Nice, 🙃
// An alternative method :
size_t strlenn(char *string){
char *end = string;
while(*end){
++end;
}
return end-string;
}

justcurious