Cartesius00
Cartesius00

Reputation: 24414

Header alloca.h in Windows

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.

Upvotes: 23

Views: 20875

Answers (2)

Gaspa79
Gaspa79

Reputation: 5615

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

#include <malloc.h>

instead. The alloca function is there

Upvotes: 3

MSalters
MSalters

Reputation: 180135

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

Upvotes: 20

Related Questions