Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
I am using scanf c to read a Y/N response
I'm using scanf %c to read a Y/N response, but later input gets skipped.
✍: Guest
You wanted scanf %c to read a single character, and it tried to, but when you tried to type that single character at it, before the rest of the input system would accept it, you had to hit the RETURN key, too. scanf read only the one character, but that extra newline was still sitting in an input buffer somewhere, and it's that extra newline (seemingly representing a phantom blank line) which was received by your later input call.
2015-10-21, 1495👍, 0💬
Popular Posts:
How To Retrieve the Count of Updated Rows? - Oracle DBA FAQ - Working with Database Objects in PL/SQ...
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]? a[i] == *...
How To Join a List of Keys with a List of Values into an Array? - PHP Script Tips - PHP Built-in Fun...
What is the difference between mysql_fetch_object() and mysql_fetch_array() functions in PHP? mysql_...
What is the difference between delegate and events? ã Actually events use delegates in bottom. But ...