20 lines · c
1#include <stdio.h>2 3int main(int argc, char const *argv[]) {4 printf("Hello world.\n"); // Set breakpoint here5 char line[100];6 if (fgets(line, sizeof(line), stdin)) {7 fprintf(stdout, "input line to stdout: %s", line);8 fprintf(stderr, "input line to stderr: %s", line);9 }10 if (fgets(line, sizeof(line), stdin)) {11 fprintf(stdout, "input line to stdout: %s", line);12 fprintf(stderr, "input line to stderr: %s", line);13 }14 if (fgets(line, sizeof(line), stdin)) {15 fprintf(stdout, "input line to stdout: %s", line);16 fprintf(stderr, "input line to stderr: %s", line);17 }18 printf("Exiting now\n");19}20