When i run the code in debug mode, instead of having output like:
testing
testing
testing
i would get some weird character like a music note for the newline escape sequence.
I'm still not sure why printf() is not translating that CR properly.
It might be relevant: Are you in China (or round-abouts) using a Chinese-language version of Windows / language pack on Windows?
It might be that the translation to double-byte or shift-JIS or whatever your system is using is not happening properly with the printf(), causing the console to display it improperly.
I don't know what to do about it, either. You might need to find a version of libc that knows about internationalization. Or there might be a compiler switch in there somewhere to turn it on. Or you might just have to
If it doesn't help, you should see if there is a forum about Chinese Windows versions and programming -- they are sure to have encountered this issue before.
I know very little about it -- I'm sitting in NJ USA with nothing more than basic Chinese language packs installed -- which do not modify my system significantly...