alloca
- Updated2023-02-21
- 1 minute(s) read
alloca
void *alloca (size_t memBlockSize);
Purpose
Allocates space on the stack for an object of specified size. The space allocated has indeterminate value.
The allocated space is deallocated automatically when you return from the function in which you allocated it.
![]() |
Note Deallocation of variable-length arrays might result in premature deallocation of space reserved by alloca. Avoid using both alloca and variable-length arrays in the same function. |
Parameters
Input | ||
Name | Type | Description |
memBlockSize | size_t | Specifies the size in bytes of the space that is allocated. |
Return Value
Name | Type | Description |
memBlockPointer | void * | Contains a pointer to the memory block allocated. If the space cannot be allocated or if the size of the space requested is zero, the function returns a null pointer. |
Additional Information
Library: ANSI C Library
Include file: ansi_c.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later