Re: File read write code

From: George (greerga@CIRCLEMUD.ORG)
Date: 04/29/98


On Wed, 29 Apr 1998, Del (Panther) wrote:

>Does anyone have/know of a snippet or code that more clearly accesses a
>file.

FILE *f = fopen("/the/file", "r");
char buffer[256];

while (!feof(f)) {
  get_line(f, buffer);
  ...do stuff with the line...
}

fclose(f);

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST