Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #67660

Re: Reading beyond the end of file

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: Reading beyond the end of file
Date 2015-08-17 20:10 -0400
Organization Self
Message-ID <55D277F4.5090905@verizon.net> (permalink)
References <b62ba036-de31-4f37-aaad-3d1372d40d3f@googlegroups.com>

Show all headers | View raw


On 08/17/2015 07:24 PM, janus wrote:
> Hello All,
> 
> I am not getting the expected result from the below code whenever I change '\0' to EOF. ... 

That's because you had incorrect expectations about what the result
would be. Was that a helpful response? If not, it's because you haven't
given us enough information to give you a more helpful response. You
should describe what inputs you used when you got unexpected results,
and what you expected the result to be, with an emphasis on the details
of how the expected result differed from the actual result.

> ... I noticed that the below will read pass the end of file. What is it that I am doing wrong? Could someone help me out?

The code you provided doesn't contain any calls to any routines that
involve files - nothing that opens them, reads them, writes them or
closes them. Therefore, it's not at all clear what the connection is
between your subject line, the above question, and this code. If your
problem does actually involve reading from a file, you need to show us
the part of your code that actually performs the read.

The code you provided relies upon the definition of the following
identifiers:
	tokens
	    type
	    txt
	    inttoken
	tokenmem
	addtokentolist
	keytab
	obplus
	obminus
	obneg
	oband
	eql
	obtimes
	obleq
	oblss
	obgeq
	obgtr
	obcolon
	obsemicolon
	period
	rbrak
	lbrak
	lparen
	rparen
	obnot
	obcomma
	obnum
	IdLen
	kwlen
	keytab
	ident
	hlist

The problem you're running into might depend upon an error in the
definition of one or more of those things - in which case we won't be
able to help you unless you provide us with those definitions. If you're
sure that one or more of those things is irrelevant, then remove the
thing that you think is irrelevant, and see if you can still reproduce
the problem. We need to see the definition of any item that you can't
remove.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Reading beyond the end of file janus <emekamicro@gmail.com> - 2015-08-17 16:24 -0700
  Re: Reading beyond the end of file Bartc <bc@freeuk.com> - 2015-08-18 00:53 +0100
    Re: Reading beyond the end of file Keith Thompson <kst-u@mib.org> - 2015-08-17 18:44 -0700
      Re: Reading beyond the end of file Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 14:41 -0700
        Re: Reading beyond the end of file Keith Thompson <kst-u@mib.org> - 2015-09-06 17:09 -0700
  Re: Reading beyond the end of file James Kuyper <jameskuyper@verizon.net> - 2015-08-17 20:10 -0400
    Re: Reading beyond the end of file janus <emekamicro@gmail.com> - 2015-08-18 00:54 -0700
      Re: Reading beyond the end of file janus <emekamicro@gmail.com> - 2015-08-18 01:43 -0700
      Re: Reading beyond the end of file James Kuyper <jameskuyper@verizon.net> - 2015-08-18 10:18 -0400
      Re: Reading beyond the end of file Barry Schwarz <schwarzb@dqel.com> - 2015-08-18 09:18 -0700
        Re: Reading beyond the end of file Keith Thompson <kst-u@mib.org> - 2015-08-18 11:17 -0700
          Re: Reading beyond the end of file Barry Schwarz <schwarzb@dqel.com> - 2015-08-18 13:24 -0700

csiph-web