Re: printf giving extra characters
- From: beginthreadex <beginthreadex@xxxxxxxxx>
- Date: Wed, 17 Jan 2007 17:10:53 -0600
On Wed, 17 Jan 2007 17:30:35 -0500, "Igor Tandetnik"
<itandetnik@xxxxxxxx> wrote:
beginthreadex <beginthreadex@xxxxxxxxx> wrote:
On Wed, 17 Jan 2007 17:07:48 -0500, "Igor Tandetnik"
<itandetnik@xxxxxxxx> wrote:
NunYa <beginthreadex@xxxxxxxxx> 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?
it's both. i can't seem to use "\r\n" on a windows XP box in the way
mentioned above, or inside Visual Studio 6 with a standard console
application that is created from the wizard.
I appologize, I know that I was confusing the situation. What I have
above is a small part of my actual code. I am also attempting to use
printf but it gives me the same output.
If I start Visual Studio 6 and create a simple "hello world"
application I want to use "\r\n" but it's translating this incorrectly
and I can get that if I use "\n" to get both characters.
I am totally lost and have no idea how to correct this.
.
- Follow-Ups:
- Re: printf giving extra characters
- From: Igor Tandetnik
- Re: printf giving extra characters
- References:
- printf giving extra characters
- From: NunYa
- Re: printf giving extra characters
- From: Igor Tandetnik
- Re: printf giving extra characters
- From: beginthreadex
- Re: printf giving extra characters
- From: Igor Tandetnik
- printf giving extra characters
- Prev by Date: Re: printf giving extra characters
- Next by Date: Re: printf giving extra characters
- Previous by thread: Re: printf giving extra characters
- Next by thread: Re: printf giving extra characters
- Index(es):
Relevant Pages
|