Re: Reading a table
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Thu, 29 Nov 2007 23:47:18 -0500
Bill Reid wrote:
Roland Pibinger <rpbg123@xxxxxxxxx> wrote in message.... snip ...
- whithout static FILE
Possibly, but the idea here is just to read a single file and
then close it right up...
- for arbitrary long lines (no hard-coded maximum line lenght)
Yes, but again the idea here is we KNOW the maximum size> of our
file lines,
However, some people want to copy files without worrying about line
length. With ggets (and fggets) you can handle this with ease, as
in the following:
[1] c:\c\junk>cc -o fcopylns.exe ggets.o junk.c
[1] c:\c\junk>fcopylns <junk.c
#include <stdio.h>
#include <stdlib.h>
#include "ggets.h"
int main(void) {
char *line;
while (0 == ggets(&line)) {
puts(line);
free(line);
}
return 0;
} /* main, fcopylns */
Note the complexity. You can get the source etc. for ggets at:
<http://cbfalconer.home.att.net/download/ggets.zip>
--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: Reading a table
- From: Bill Reid
- Re: Reading a table
- References:
- Reading a table
- From: Stephen . Schoenberger
- Re: Reading a table
- From: user923005
- Re: Reading a table
- From: Stephen . Schoenberger
- Re: Reading a table
- From: Bill Reid
- Re: Reading a table
- From: Roland Pibinger
- Re: Reading a table
- From: Bill Reid
- Reading a table
- Prev by Date: Re: malloc realloc and pointers
- Next by Date: Re: malloc realloc and pointers
- Previous by thread: Re: Reading a table
- Next by thread: Re: Reading a table
- Index(es):
Relevant Pages
|