Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 362 Bytes

README.md

File metadata and controls

25 lines (22 loc) · 362 Bytes

3.71

#include <stdio.h>
#include <assert.h>
#define BUF_SIZE 12

void good_echo(void) {
  char buf[BUF_SIZE];
  while(1) {
    /* function fgets is interesting */
    char* p = fgets(buf, BUF_SIZE, stdin);
    if (p == NULL) {
      break;
    }
    printf("%s", p);
  }
  return;
}

int main(int argc, char* argv[]) {
  good_echo();
  return 0;
}