delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/03/07/12:24:32

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Wed, 7 Mar 2007 12:24:01 -0500
Message-Id: <200703071724.l27HO1ua014362@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <45EEEB0C.2070109@mainstreetsoftworks.com> (message from Brad
House on Wed, 07 Mar 2007 11:40:44 -0500)
Subject: Re: line feed
References: <c29 DOT f754a8b DOT 33203d1b AT aol DOT com> <45EEEB0C DOT 2070109 AT mainstreetsoftworks DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> #if defined(_WIN32) || defined(__DJGPP__)
> #  define NEWLINE "\r\n"
> #else
> #  define NEWLINE "\n"
> #endif
> 
> printf("Hello World" NEWLINE);
> 
> And get the proper behavior on your expected systems.

No, this is wrong on DJGPP and Windows.  You'll get \r\r\n in your
output.  Please use just "\n" for newlines, on all systems, and use
text vs binary mode as appropriate.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019