How big is the argv[] array?

jim nutt jim.nutt at p11.f15.n114.z1.fidonet.org
Sat Oct 29 12:19:34 AEST 1988


 ND> In article <660020 at hpclscu.HP.COM>, shankar at hpclscu.HP.COM (Shankar 
 ND> Unni) writes:
 ND> >   argv = (char **) realloc (argv, newsize * sizeof (char *))
 ND> >      /* newsize is the size of your expanded argv array */
 ND> 
 ND> What does realloc do when its first argument is a pointer to storage
 ND> that was not obtained by malloc?  Maybe you won't crash until your
 ND> program exits and the shell reads the next command line?

it varies seriously on microcomputer compilers.  borland's turbo c handles it 
least gracefully, with msc a little more friendly...  zortech c waits until 
the program ends to die....  it also depends on the memory model...

jim nutt
'the computer handyman'



--  
St. Joseph's Hospital/Medical Center - Usenet <=> FidoNet Gateway
Uucp: ...{gatech,ames,rutgers}!ncar!noao!asuvax!stjhmc!15.11!jim.nutt
Internet: jim.nutt at p11.f15.n114.z1.fidonet.org



More information about the Comp.lang.c mailing list