returning automatic variables
Henry Spencer
henry at zoo.toronto.edu
Sat May 25 02:50:49 AEST 1991
In article <1991May24.153133.13590 at ux1.cso.uiuc.edu> nnj20229 at uxa.cso.uiuc.edu (Nesha Nicole Jones) writes:
>... Is it possible to return an automatic string form a function...
Basically, no. The string has to be contained in storage that will survive
after the function returns. Automatic variables don't. You either have to
use a static buffer for the returned value, or use malloc().
--
And the bean-counter replied, | Henry Spencer @ U of Toronto Zoology
"beans are more important". | henry at zoo.toronto.edu utzoo!henry
More information about the Comp.lang.c
mailing list