RosettaCodeData/Task/Memory-allocation/C/memory-allocation-3.c
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

8 lines
251 B
C

#include <alloca.h>
int *funcA()
{
int *ints = alloca(SIZEOF_MEMB*NMEMB);
ints[0] = 0; /* use it */
return ints; /* BUT THIS IS WRONG! It is not like malloc: the memory
does not "survive"! */
}