D
David. E. Goble
Hi all;
I need to build a list of strings in one function and use the list in
another function.
ie
buildlist(char list[][], FILE **infile);
{
int i;
....
while(fgets(line, LINESIZE, *infile)!=NULL)
{
list[strlen[line])=line;
/* I assume I will need malloc here some how? */
}
....
}
main(....)
{
FILE *infile, *outfile
char list[][];
buildlist(char list[][], &infile);
....
uselist(list[][], &outfile);
....
}
But this is all I remember... As you can see I need help.
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223
I need to build a list of strings in one function and use the list in
another function.
ie
buildlist(char list[][], FILE **infile);
{
int i;
....
while(fgets(line, LINESIZE, *infile)!=NULL)
{
list[strlen[line])=line;
/* I assume I will need malloc here some how? */
}
....
}
main(....)
{
FILE *infile, *outfile
char list[][];
buildlist(char list[][], &infile);
....
uselist(list[][], &outfile);
....
}
But this is all I remember... As you can see I need help.
Regards David. E. Goble
http://www.pnc.com.au/~degoble
degoble[AT]pnc.com.au | dgoble[AT]pnc.com.au
Po Box 648 (9 Murray St), Kingscote, Kangaroo Island SA 5223