MSC 5.0 Bug???

Duane E. Ellis deest1 at cisunx.UUCP
Fri Feb 19 07:40:50 AEST 1988


The problem you have with MSC, is MSC's BINARY I/O verses ASCII I/O
when you fopen() the file, make sure you are specing BINARY, other
wise, MSC is probably doing a newline map on you.

Example:

main()
{
FILE *fp, *fopen();
	fp=fopen("myfile","w");
	fwrite("\n",sizeof(char),1,fp); /* WRITE ONE CHAR ONLY!!! */
	flcose(fp);
}

In some cases, MSC will map the \n to \r\n, to match PC-DOS.
I Bet that's the problem you are seeing.. 



More information about the Comp.lang.c mailing list