[ale] C Programming Question

JB Wells jbwellsiv at yahoo.com
Sun Mar 11 23:58:56 EST 2001


yup my bad. or to be more precise

char **a=(char **)malloc(sizeof(char *) * WHATEVER));

although pointer size is the same ;-)


--- "Eric Z. Ayers" <eric.ayers at mindspring.com> wrote:
> JB Wells wrote:
> > 
> > I think this will work:
> > 
> > char **a=(char **)malloc (sizeof(char **));
> 
> ^^ You need to change this line:
> char **a=(char **)malloc (sizeof(char **) *
> WHATEVER);
> 
> > 
> > for (i=0; i<WHATEVER; i++)
> > {
> >     /* if the pointer will be pointing to a
> string,
> >        you should change it to
> >        (char *)malloc(sizeof(char) *
> strlen(STRING))*/
> > 
> >     a[i]=(char *)malloc(sizeof(char *));
> > }
> > 
> > =====
> > --------------------------
> > John B. Wells IV
> > Application Developer
> > Acterna
> > 6100 Lake Forrest Drive
> > Atlanta, GA  30328
> > 404.531.8938
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> > --
> > To unsubscribe: mail majordomo at ale.org with
> "unsubscribe ale" in message body.
> --
> To unsubscribe: mail majordomo at ale.org with
> "unsubscribe ale" in message body.


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list