Home  |   Notes  |   Languages  |   Programs  |   Homework

Re: Newline characters

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

Michael Witczak (mwitczak@VT.EDU)
Sun, 30 Sep 2001 18:08:08 -0400


Message-ID:  <NNEDIFLPMDIECDCGIKEDIEDKCDAA.mwitczak@vt.edu>
Date:         Sun, 30 Sep 2001 18:08:08 -0400
From: Michael Witczak <mwitczak@VT.EDU>
Subject:      Re: Newline characters

-----Original Message-----
From: discussion list [mailto:CS3304_91312@listserv.vt.edu]On Behalf Of
?idesmack
Sent: Thursday, September 27, 2001 10:15 PM
To: CS3304_91312@LISTSERV.VT.EDU
Subject: Re: [CS3304_91312] 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>