RosettaCodeData/Task/Memory-allocation/C/memory-allocation-3.c

9 lines
251 B
C
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
#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"! */
}