gno/lib/libc/tests/stdio/fgets1.c
1997-09-05 06:46:33 +00:00

19 lines
360 B
C

#pragma lint -1
#pragma debug 25
#include <stdio.h>
#define BUFFERSIZE 1024
char buffer[BUFFERSIZE];
int main(int argc, char **argv) {
printf("hello, world\n");
fprintf(stderr, "please enter a string: ");
if (fgets(buffer, BUFFERSIZE, stdin) == NULL) {
printf("fgets failed\n");
} else {
printf("input string was \"%s\"\n", buffer);
}
return 0;
}