How big is the argv[] array?

Shankar Unni shankar at hpclscu.HP.COM
Thu Oct 6 03:56:28 AEST 1988


Re: Expanding the argv array:

Try:

  argv = (char **) realloc (argv, newsize * sizeof (char *))
     /* newsize is the size of your expanded argv array */
  for (ctr = OLDargc; ctr < newsize; ctr++)
	argv[ctr] = (char *) 0;
  /* now append arguments to your heart's content.. */

	/* NO COMMENTS ABOUT PASCAL'ish CODING!!! :-) */

--
Shankar.



More information about the Comp.lang.c mailing list