fork download
  1. int strstr(char *haystack, char *needle)
  2. {
  3. int i = 0;
  4. while (haystack[i] != needle[0] || haystack[i] != '\0')
  5. {
  6. i++;
  7. }
  8. if (haystack[i] == '\0')
  9. {
  10. return NULL;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int strstr(char*, char*)’:
prog.cpp:10: error: ‘NULL’ was not declared in this scope
prog.cpp:11: error: expected `}' at end of input
stdout
Standard output is empty