Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changes between Version 18 and Version 19 of ChapterIoConsole

Show
Ignore:
Author:
larsivi (IP: 84.48.50.144)
Timestamp:
01/27/08 00:45:01 (16 years ago)
Comment:

Moved FAQ

Legend:

Unmodified
Added
Removed
Modified
  • ChapterIoConsole

    v18 v19  
    195195 
    196196'''Caution: the use of printf is not recommended. Use it only for low level debugging and when you know what you're doing.''' 
    197  
    198 == FAQ == 
    199  
    200 Q: How can I redirect the console output?[[br]] 
    201 A: The associated stream can be reassigned. Its possible to redirect the lowest level (Cout/Cerr) or only the formatted output (Stdout/Stderr). 
    202 {{{ 
    203 #!d 
    204 Cout.output( new FileOutput("redirected")); 
    205 Stdout.stream( new FileOutput("redirected")); 
    206 }}} 
    207  
    208 Q: How to make the program waiting for pressing the enter key?[[br]] 
    209 A: Use  
    210 {{{ 
    211 #!d 
    212 Cin.get(); 
    213 }}} 
    214 This reads the next line from the Cin, so pressing just enter is an empty line. If you want to check (or poll) for a key hit, use the C functions like kbhit(), getc(). 
    215