#include /***** * * This program reads strings from stdin, with each string up to 100 chars. * This program *assumes* that each string is no more that 100 chars. * Question -- is this a safe assumption? * */ #define STRING_SIZE 1 int main() { /* Variable s is a string with 100 usable chars, and null termination. */ char s[STRING_SIZE + 1]; int input_status; /* Return value from scanf */ printf("Input strings up to 100 chars long, quit at EOF:\n"); input_status = scanf("%s", s); while (input_status != EOF) { printf("Confirmed input: %s\n", s); input_status = scanf("%s", s); } return 0; }