|
|
back to boardAbout ends of lines When //CPP archive type is chosen one must pay attention to the following: C++ compiler works under Windows, so when you print to stdout one character with code 10 (\n) it prints two characters: 13 and 10 (CR LF) Be sure to print only one character 10 (not 13 and then 10) for each end of line in input. Re: About ends of lines Thanks. Useful hint. Re: About ends of lines Please tell me how can I write only one '\n'? On my computer I use _setmode( _fileno( stdin[stdout] ), _O_BINARY ); it is in <io.h> header, and there is no such header on timus server. how can I write only one '\n' with out using binary reading/writing? or how can I open stdin in binary mode? Edited by author 10.03.2010 10:03 Re: About ends of lines Correction: in default (text) mode you need to write only '\n'. In binary mode (if you can enable it) you would need to write both '\r' and '\n'. |
|
|