Changes between Version 18 and Version 19 of ChapterIoConsole
- Timestamp:
- 01/27/08 00:45:01 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ChapterIoConsole
v18 v19 195 195 196 196 '''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 #!d204 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: Use210 {{{211 #!d212 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