fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. FILE *file = stdin;
  5. int ch;
  6. char buf[50] = "";
  7.  
  8. for(size_t i = 0; i < sizeof(buf)-1 && (ch = fgetc(file)) != EOF; ++i){
  9. buf[i] = ch;
  10. buf[i+1] = '\0';
  11. }
  12. printf("%s", buf);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 10320KB
stdin
What are little boys made of?
What are little boys made of?
  Snips and snails
  And puppy-dogs' tails
That's what little boys are made of

What are little girls made of?
What are little girls made of?
  Sugar and spice
  And everything nice
That's what little girls are made of
stdout
What are little boys made of?
What are little boy