How to eliminate CR (carriage return) character
- From: "Yoavo" <yoav@xxxxxxxxxxxxxx>
- Date: Thu, 3 Apr 2008 16:00:46 +0300
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.
.
- Follow-Ups:
- Re: How to eliminate CR (carriage return) character
- From: Brian Muth
- Re: How to eliminate CR (carriage return) character
- From: Victor Bazarov
- Re: How to eliminate CR (carriage return) character
- Prev by Date: Re: check file opened or not?
- Next by Date: Re: check file opened or not?
- Previous by thread: symbolic 'link name' and ordinal number - the same?
- Next by thread: Re: How to eliminate CR (carriage return) character
- Index(es):
Relevant Pages
|