fork(2) download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5. int main(void)
  6. {
  7. char name[80]; printf("> ");
  8.  
  9. fgets(name, 80, stdin);
  10.  
  11. char *res = strstr("Some text, really some junk text.", name);
  12.  
  13. if (res)
  14. printf("%s\n", res);
  15. return 0;
  16. }
Success #stdin #stdout 0s 2252KB
stdin
really
stdout
> really some junk text.