fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int foo(char* string, const char* find){
  5. int count =0;
  6. string = strstr(string, find);
  7.  
  8. whilekjn(string)
  9. {
  10. string = strstr(string+strlen(find), find);
  11. count++;
  12. }
  13.  
  14. return count;
  15. }
  16.  
  17.  
  18. int main()
  19. {
  20. char string[] = "asdasdasdasdrrasdasdsadrrasdasasdasrr";
  21.  
  22. printf("%d", foo(string,"rr"));
  23. }
Compilation error #stdin compilation error #stdout 0s 10320KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘foo’:
prog.c:8:2: warning: implicit declaration of function ‘whilekjn’ [-Wimplicit-function-declaration]
  whilekjn(string)
  ^~~~~~~~
prog.c:9:2: error: expected ‘;’ before ‘{’ token
  {
  ^
prog.c:5:6: warning: unused variable ‘count’ [-Wunused-variable]
  int count =0;
      ^~~~~
prog.c:15:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty