Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
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, 1649👍, 0💬
Popular Posts:
What is cross page posting? By default, button controls in ASP.NET pages post back to the same page ...
How Large Can a Single Cookie Be? - PHP Script Tips - Understanding and Managing Cookies How large c...
What is the benefit of using #define to declare a constant? Using the #define method of declaring a ...
How To Compile a JUnit Test Class? Compiling a JUnit test class is like compiling any other Java cla...
How many types of validation controls are provided by ASP.NET ? There are six main types of validati...