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 reading strings typed by the user into an array ...
I'm reading strings typed by the user into an array, and then printing them out later. When the user types a sequence like \n, why isn't it being handled properly?
✍: Guest
Character sequences like \n are interpreted at compile time. When a backslash and an adjacent n appear in a character constant or string literal, they are translated immediately into a single newline character. (Analogous translations occur, of course, for the other character escape sequences.) When you're reading strings from the user or a file, however, no interpretation like this is performed: a backslash is read and printed just like any other character, with no particular interpretation.
(Some interpretation of the newline character may be done during run-time I/O, but for a completely different reason
2016-03-04, 1244👍, 0💬
Popular Posts:
Why does malloc(0) return valid memory address? What's the use? malloc(0) does not return a non-NULL...
How To Control Padding Spaces within a Table Cell? - XHTML 1.0 Tutorials - Understanding Tables and ...
How To Set Background to Transparent or Non-transparent? - CSS Tutorials - HTML Formatting Model: Bl...
How do we configure “WebGarden”? “Web garden” can be configured by using process model settings in...
What are the two kinds of comments in JSP and what's the difference between them? <%-- JSP Co...