fork download
  1. #include <stdio.h>
  2. #include <ctype.h>
  3.  
  4. int main(void) {
  5. char buf[100] = {0}, * cur = buf, * end = buf + sizeof buf - 1;
  6. int c;
  7.  
  8. while ((c = fgetc(stdin)) != EOF && cur < end) {
  9. if (!isspace(c))
  10. *cur++ = c;
  11. continue;
  12. }
  13. printf("[%s]\n", buf);
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 1724KB
stdin
This is a test.
stdout
[Thisisatest.]