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"
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; }
super short and sweet way to explain this concept! Thank you for the video!
You're welcome! :-D
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"
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;
}