Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: Newline characters

New Message Reply About this list Date view Thread view Subject view Author view

§ídësmâçk (csides@VT.EDU)
Thu, 27 Sep 2001 22:14:45 -0400


Message-ID:  <4.3.0.20010927221332.01ba9788@mail.vt.edu>
Date:         Thu, 27 Sep 2001 22:14:45 -0400
From: §ídësmâçk <csides@VT.EDU>
Subject:      Re: Newline characters

Prof. Edwards,

I got a 0 every time I submitted my program. Today, I handed in my printed
code. Since the TA is going to subtract more points from my program, how
will he grade mine since I never got any points to begin with?
-Chris

At 08:37 PM 9/27/2001 -0400, you wrote:
> > I know there are a couple ways to test for the end of line
>
>The preferred method is to call the boolean function Eoln to
>detect newlines and to use readln to read in/skip over them.
>
> > for some reason
> > I will read in a newline character one time and my program will
> > say it is an invalid token and then the next
> > time it will recongize it as an end of expression token.
>
>Remember that on PCs, a "new line" in a text file is represented
>by a two-character sequence: a carriage return character (CR)
>followed by a line feed character (LF). If you are reading one
>character at a time, it will take two reads to process this
>CR-LF pair. My guess is that you are only recognizing one of
>the two characters as an end-of-expression token (probably the
>linefeed).
>
>
> -- Steve
>
>--
>Stephen Edwards 604 McBryde Hall Dept. of Computer Science
>e-mail : edwards@cs.vt.edu U.S. mail: Virginia Tech (VPI&SU)
>office phone: (540)-231-5723 Blacksburg,
>VA 24061-0106
>-------------------------------------------------------------------------------
>


New Message Reply About this list Date view Thread view Subject view Author view

Home  |   Notes  |   Languages  |   Programs  |   Homework
copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Class site maintained by Stephen H. Edwards <edwards@cs.vt.edu>