How to eliminate CR (carriage return) character

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



We are trying to output a file with LF (line feed) only (ascii char 10),
but we get also the CR (carriage return) character (ascii char 13).

Here is our program:

int _tmain(int argc, _TCHAR* argv[])
{
FILE *fp = fopen("tmp.bin", "w");
char c1 = 10;
fprintf(fp, "line1 %c line2", c1 );
return 0;
}


And the binary output is:

6C 69 6E 65 31 20 0D 0A 20 6C 69 6E 65 32 line1 line2


How do we output a line with LF and not CR?

Thanks,
Yoav.



.



Relevant Pages

  • Re: How to eliminate CR (carriage return) character
    ... but we get also the CR (carriage return) character (ascii char ... And the binary output is: ...
    (microsoft.public.vc.language)
  • Re: Convert Ascii Character to decimal
    ... Is it sending over a character or a byte? ... I do not answer questions on behalf of my employer. ... programmer helping programmers. ... > ASCII Char 'NUL' will become 0 ...
    (microsoft.public.dotnet.general)
  • Re: newb TASM user needs help
    ... > am kinda new I still dont know a few things. ... > than the ASCII char of the binary. ... resulting character to the screen. ...
    (alt.lang.asm)
  • Convert Ascii Character to decimal
    ... I am reading from a serial port from a device which sends over an ascii ... It uses the full extended 256 character set and therefore has ... ASCII Char 'NUL' will become 0 ...
    (microsoft.public.dotnet.general)
  • Re: How to eliminate CR (carriage return) character
    ... but we get also the CR (carriage return) character (ascii char 13). ...
    (microsoft.public.vc.language)