Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: problem in priniting new line in a logfile

Author: Daniel Clausen

Date: 04:51:02 11/11/03

Go up one level in this thread


On November 11, 2003 at 06:31:56, Uri Blass wrote:

>I try to generate a logfile for movei and I have a problem when I try to
>write a new line because for some reason fprintf does not give me a new line
>
>fprintf(logmovei,"\n"); does not help when I have no problem to write my
>name in the logfile by fprintf(logmovei,"uri");

You're probably opening the file in binary mode.

Newlines under different OSes:

Unix: Newline = 0x0a
Mac : Newline = 0x0d
Dos : Newline = 0x0d 0x0a

Opening the file in ascii-mode and writing "\n" should automatically be
concerted to the right thing.

Hope this helps

Sargon



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.