strpbrk.c 537 B

1234567891011121314151617181920
  1. #include <string.h>
  2. #include <stdio.h>
  3. int main(void) {
  4. char* source = "The quick drawn fix jumps over the lazy bug";
  5. // should be "The quick drawn fix jumps over the lazy bug"
  6. char* res1 = strpbrk(source, "From The Very Beginning");
  7. printf("%s\n", (res1) ? res1 : "NULL");
  8. // should be "lazy bug"
  9. char* res2 = strpbrk(source, "lzbg");
  10. printf("%s\n", (res2) ? res2 : "NULL");
  11. // should be "NULL"
  12. char* res3 = strpbrk(source, "404");
  13. printf("%s\n", (res3) ? res3 : "NULL");
  14. return 0;
  15. }