22

I can't see any alloca.h equivalent in Visual C 2010. How can one perform stack allocation in Visual C on Windows? I miss the function alloca.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Cartesius00
  • 23,584
  • 43
  • 124
  • 195

2 Answers2

19

See _alloca. Visual C uses an _ prefix for non-standard functions in the C headers.

MSalters
  • 173,980
  • 10
  • 155
  • 350
3

There's no alloca.h in windows. You should

#include <malloc.h>

instead. The alloca function is there

Gaspa79
  • 5,488
  • 4
  • 40
  • 63