All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Stalp <stalp@imbei.uni-mainz.de>
To: linux-c-programming@vger.kernel.org
Subject: feof fails
Date: Wed, 15 Sep 2004 11:39:48 +0200	[thread overview]
Message-ID: <B0003441729@hermes.imsd.uni-mainz.de> (raw)

Hello together,
I have a simple problem. I opened a file with fopen and read from the file 
with:
  while ( !feof( infile ) )
 {
   fgets( buffer, BUFFER_SIZE, infile );
   new_number = atoi ( buffer );
.....

The file is filled withe a stack of numbers, 7 charakters and each is 
terminated by an '\n'. 

My problem now is, that the last number is been read twice. What is the 
problem?

Gruss Christian


-- 
Christian Stalp

Institut für Medizinische Biometrie, Epidemiologie und Informatik (IMBEI)
Obere Zahlbacher Straße 69
55131 Mainz
Tel.: 06131/ 17-6852

E-Mail: stalp@imbei.uni-mainz.de
Internet: www.imbei.de
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2004-09-15  9:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15  9:39 Christian Stalp [this message]
2004-09-15 11:13 ` feof fails Pankaj
2004-09-15 14:23 ` Charlie Gordon
  -- strict thread matches above, loose matches on Subject: below --
2004-09-15 14:57 Huber, George K RDECOM CERDEC STCD SRI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B0003441729@hermes.imsd.uni-mainz.de \
    --to=stalp@imbei.uni-mainz.de \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.