How big is the argv[] array?

Ron Natalie ron at ron.rutgers.edu
Fri Oct 7 03:03:38 AEST 1988


>  argv = (char **) realloc (argv, newsize * sizeof (char *))

NO, NO, NO!  THIS WILL NEVER WORK!

You can't realloc something that wasn't malloc'd.  You can't make
the assumption that argv was allocated by malloc, because it isn't
true.  ARGV is usually found on the stack, but even that is an left
up to the implementation.

-Ron



More information about the Comp.lang.c mailing list