EOL WAR

Jeffery A. Cavallaro jeff at isi-vaxa.ARPA
Sat Sep 7 06:49:16 AEST 1985


HOLD IT, HOLD IT !!!

Sorry to start such a war by suggesting:

#define		EOL		'\0'

I had used this definition a couple of times when manipulating text coming
from human-type interfaces (i.e. computer control of human interfaces).
Programs fielding input from such interfaces must not depend on the presence
of format characters (e.g. \n or \r) because these human interfaces are very
loose and dynamic from version to version.  While manipulating such "lines"
of text, I would remove format characters and terminate the string with an
EOL (\0).

#define		EOS		'\0'
#define		EOL		'\n'

These are not wrong, but \n as EOL has a bad taste when dealing with such
interfaces.  They are fine as long as you stay within the VAX-11 4.2BSD
(or similar) environment.

					Jeff



More information about the Comp.lang.c mailing list