strpbrk.c 548 B

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