Advertisement
ddacruz

day10 ex04

Jul 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. 9 int isupcase(char *str)
  2. 30 {
  3. 31 if (!*str)
  4. 32 return (1);
  5. 33 return ('A' <= *str && *str <= 'Z' ? isupcase(str + 1) : 0);
  6. 34 }
  7. 35
  8. 36 #include <stdio.h>
  9. 37 int main()
  10. 38 {
  11. 39 char *words1[] = {"Hello", "World", "RTFM", "LMGIFY", "GIYF", "NSFW", 0};
  12. 40 char *words2[] = {"O miseras", "homini", "mentis", "O pectora", "caeca", 0};
  13. 41 if (ft_count_if(words1, &isupcase) == 4 && !ft_count_if(words2, &isupcase))
  14. 42 printf("ok");
  15. 43 else
  16. 44 printf("nope");
  17. 45 return (0);
  18. 46 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement