comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: how to read a file into a array???
Date: 05 May 2002 07:20:10 +0100
Date: 2002-05-05T07:20:10+01:00	[thread overview]
Message-ID: <x7v8z6zqfol.fsf@pushface.org> (raw)
In-Reply-To: 3CD45E7D.2DA637B5@attbi.com

Mark Biggar <mark.a.biggar@attbi.com> writes:

> Don't bother.  Slurp the whole file into one big string and then
> parse and create an array of records containing indices to the first
> and last character of each word.  Write an access function that
> takes an index and returns the corresponding slice.

This isn't a general solution, though; how long a string do you need?
I suppose you could use file io operations, if your compiler provides
them, to work out the length first .. it seems unwise to get into the
habit of assuming a maximum size to whatever your input may be.



      parent reply	other threads:[~2002-05-05  6:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-04 18:35 how to read a file into a array??? devine
2002-05-04 19:05 ` Jeffrey Carter
2002-05-04 22:24   ` Mark Biggar
2002-05-05  2:18     ` devine
2002-05-05  3:52       ` Dale Stanbrough
2002-05-17  8:50       ` GNU Readline ? Sylvain NAHAS
2002-05-17 10:25         ` Adrian Knoth
2002-05-17 19:21           ` Thomas Dickey
2002-05-05  6:20     ` Simon Wright [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox