Re: printf giving extra characters
beginthreadex <beginthreadex@gmail.com> wrote:
On Wed, 17 Jan 2007 17:07:48 -0500, "Igor Tandetnik"
<itandetnik@mvps.org> wrote:
NunYa <beginthreadex@gmail.com> wrote:
Is there a #define that I am missing that is attempting to do some
sort of conversion from "\n" to "\r\n" ????
This is a standard behavior on Windows of a stream opened in text
mode (see fopen, "t" vs "b" modes). stdout happens to be one such
stream.
That's fantastic!! The issue is that I am using this:
char szText = "some text\r\nsome more";
HANDLE hStdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
WriteFile(hStdHandle, szText, strlen(szText), NULL, NULL);
WriteFile should not perform any translation. It always treats the file
as binary.
Your original post mentioned printf, but the code you show now does not
use printf. I'm confused. Which way is it in your actual code?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925