strpbrk() function | C Programming Tutorial

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

super short and sweet way to explain this concept! Thank you for the video!

personalitymain
Автор

good tutorial, but would be nice if you let us know what strpbrk actually stands for, so it would be easier to remember, and im just generally curious
edit: it stands for "string pointer break"

mastermax
Автор

the best way to understand a function is by making it:
char* str_pbrk(const char* s1, const char* s2) {
size_t s1_len = strlen(s1);
size_t s2_len = strlen(s2);

for (int i = 0; i < s2_len; i++) {
for (int j = 0; j < s1_len; j++) {
if (s2[i] == s1[j]) {
return (s1 + j);
}
}
}

return NULL;
}

deepblackoutlaw
welcome to shbcf.ru