#: 20862 S3/Languages
25-Mar-95 12:53:23
Sb: #scanf() question
Fm: David Breeding 72330,2051
To: ALL
How do you all handle this?
scanf( "%d",num);
gets( "%s", string);
Seems what happens, scanf gets the number, but leaves the carriage return
buffered, and on a subsequent gets(), or any other string call.. it
retrieves the newline. The only remedy I could come up with is to follow
each scanf() with a getchar(). It works, but doesn't seem very elegant.
Any "elegant" solutions?
-- David Breeding --
CompuServe : 72330,2051 Delphi : DBREEDING
*** Sent via InfoXpress/OSK - Vr. 1.02 ***
There is 1 Reply.
|