User forums > Using Code::Blocks

Strange output in CodeBlocks with gcc in Windows

<< < (2/2)

Michael:

--- Quote from: jimshen on March 06, 2006, 01:37:38 pm ---The result is not same as the result in linux. Please see the first message I modified.

--- End quote ---

Yes, I know. I have read the modified version already and tried myself in ubuntu :). I have done some tests, both in Window and in Linux. When I only use \b, the behaviour seems to be the same. But when I use \t\b then the result is different.

Best wishes,
Michael

jimshen:

--- Quote from: Michael on March 06, 2006, 01:53:10 pm ---
But when I use \t\b then the result is different.

Best wishes,
Michael


--- End quote ---

That's the problem trouble me.

thomas:
Don't blame the compiler, it does exactly what you tell it to. If you do a hexdump of the executable, you will see that the text location in question reads 25 64 09 08 25 64. It does exactly what you asked for.

It is the MSVCRT which does not handle it correctly. Obviously, Microsoft does not expect anyone to mix tabs and backspaces (I could not imagine a good reason to do so either).

jimshen:

--- Quote from: thomas on March 06, 2006, 02:04:38 pm ---Don't blame the compiler, it does exactly what you tell it to. If you do a hexdump of the executable, you will see that the text location in question reads 25 64 09 08 25 64. It does exactly what you asked for.

It is the MSVCRT which does not handle it correctly. Obviously, Microsoft does not expect anyone to mix tabs and backspaces (I could not imagine a good reason to do so either).

--- End quote ---

Thank you very much. I build the program in Visual c++ and got the same result. It seems that is the problem of MSVCRT.
The code is in a book I'm reading now.

Navigation

[0] Message Index

[*] Previous page

Go to full version