[ILUG-BOM] Re: Buggy C prog

Amish Mehta amish@[EMAIL-PROTECTED]
Fri Sep 27 09:43:13 IST 2002


Hi,

You got divine hands :-). Though it worked, you should still allocate
memory to arg itself for holding array of pointers. Something like

arg = (char **) malloc(sizeof(char *) * 6);
arg[5] = NULL;

Amish.

Nikhil Joshi wrote:
> >Hi!
>success afterall ...
>I used following to allocate memory to arg
>
>for (i=1;i<4;i++)
>      if ((arg[i] = (char *) malloc (30)) == NULL)



More information about the Linuxers mailing list