/* * input_crash.c * * why scanf is problematic. * */ #include // read in a string, and then print it back. void echo(){ char buffer[8]; printf("Type something: "); scanf("%s", buffer); printf("You said: '%s'\n\n", buffer); } int main(){ int i; for (i=0; i<10; i++){ echo(); } return 0; }