Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!netcomsv!bobb From: bobb@netcom.COM (Bob Beaulieu) Newsgroups: comp.lang.c Subject: Re: I need help with this structure loop(?) Summary: flushing the buffer Message-ID: <1991May28.235138.24625@netcom.COM> Date: 28 May 91 23:51:38 GMT References: <789@ra.MsState.Edu> Distribution: usa Organization: Netcom - Online Communication Services UNIX System {408 241-9760 guest} Lines: 21 In article <789@ra.MsState.Edu>, cee1@ra.MsState.Edu (The Chuckmeister) writes: > puts("Finally, enter the year published."); > printf("[....]\b\b\b\b\b"); > scanf("%d", &inventory[count].year); fflush(stdin); This addition lets your program work just fine for me. I believe another scanf would do the same job (get rid of the newline); Hope it help! bobb -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Bob Beaulieu | | San Jose, CA. | | (408) 723-0556 | | bobb@netcom.com | | {apple,amdahl,claris}!netcom!bobb | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~