Mail Archives: djgpp/1998/11/06/18:25:11
Steve Chapel wrote:
> int numlines=10;
> input=(char **)malloc(10);
>
> Shouldn't that be
> input = (char **)malloc(numlines * sizeof(char **));
> as written, your program allocates 10 bytes, not room for 10 char
> **'s.
An array of 10 char *s, not an array of 10 char **s.
input = (char **) malloc(numlines*sizeof(char *));
--
Erik Max Francis / email max AT alcyone DOT com / whois mf303 / icq 16063900
Alcyone Systems / irc maxxon (efnet) / finger max AT sade DOT alcyone DOT com
San Jose, CA / languages En, Eo / web http://www.alcyone.com/max/
USA / icbm 37 20 07 N 121 53 38 W / &tSftDotIotE
\
/ Give me chastity, but not yet.
/ St. Augustine
- Raw text -