pointers to arrays
braner
braner at batcomputer.tn.cornell.edu
Fri Nov 21 05:35:34 AEST 1986
[]
Oops: I forgot to add that another advantage of the "char *line[]"
approach is that you can do:
char **cp;
cp = &line[k];
...
cp++; /* point to pointer to next line */
- there is no need for a multiplication in the last statement, and,
even more important, you can do all that in a function which does not
"know" the length of a "line" - it can be written to work with any
length, by passing the line[] to it instead of page[]! You do have
to initialize line[] first, as posted.
- Moshe Braner, Cornell University
More information about the Comp.lang.c
mailing list