comp.lang.ada
 help / color / mirror / Atom feed
* files and character arrays..
@ 2002-05-14  2:30 devine
  2002-05-14  7:28 ` chris.danx
  0 siblings, 1 reply; 2+ messages in thread
From: devine @ 2002-05-14  2:30 UTC (permalink / raw)


Hi.  I was wandering if anyone had an example of a program that reads
in characters into an array from a file?  I have seen many programs
that read integers but I have not found a program that reads
characters into an array.
Thanks for the help.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: files and character arrays..
  2002-05-14  2:30 files and character arrays devine
@ 2002-05-14  7:28 ` chris.danx
  0 siblings, 0 replies; 2+ messages in thread
From: chris.danx @ 2002-05-14  7:28 UTC (permalink / raw)



"devine" <devine@linuxmail.org> wrote in message
news:e6a474c.0205131830.1283b0d9@posting.google.com...
> Hi.  I was wandering if anyone had an example of a program that reads
> in characters into an array from a file?  I have seen many programs
> that read integers but I have not found a program that reads
> characters into an array.

Do you want to read a whole lotof characters at a time, or one at a time?
The functions get and get_line from ada.text_io are useful for this.  Note
that get_line works for strings, while get will work for strings or
characters (and other things).  Check the ada reference manual section
A.10.1 or John English's online book (don't have the link for the book
sorry, try www.adapower.com) for more.

Reading characters from a file is really quite similar to reading integers
from a file.  The code might be (slightly) different, but the principles are
the same.  Look in JEs book, there's probably something in there!

HTH,
Chris





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-14  7:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-14  2:30 files and character arrays devine
2002-05-14  7:28 ` chris.danx

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