Guest User

Untitled

a guest
Nov 20th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int is_in_f(char *s, char c) {
  5. while(*s) {
  6. if(*s==c) return 1;
  7. else s++;
  8. }
  9. return 0;
  10. }
  11.  
  12. int main() {
  13. char *name = "paria llls";
  14. char string1[] = "a";
  15. if(is_in_f(*name, string1)){
  16. printf("found");
  17. }
  18.  
  19. return 0;
  20. }
  21.  
  22. E2.c: In function ‘main’:
  23. E2.c:14:19: warning: passing argument 2 of ‘is_in_f’ makes integer from pointer without a cast [-Wint-conversion]
  24. if(is_in_f(name, string1)){
  25. ^~~~~~~
  26. E2.c:3:5: note: expected ‘char’ but argument is of type ‘char *’
  27. int is_in_f(char *s, char c) {
Add Comment
Please, Sign In to add comment