apush¶
Category: array
GitHub: cute_array.h
Pushes an element onto the back of the array.
Parameters | Description |
---|---|
a | The array. Can be NULL . |
... | The element to push. |
Return Value¶
Returns the pushed element.
Code Example¶
Pushing some elements onto an array and asserting their values.
dyna int a = NULL;
apush(a, 5);
apush(a, 13);
CF_ASSERT(a[0] == 5);
CF_ASSERT(a[1] == 13);
CF_ASSERT(asize(a) == 2);
afree(a);
Remarks¶
a
is automatically re-assigned to a new pointer if the array was internally regrown. If a
is NULL
a new
dynamic array is allocated on-the-spot for you, and assigned back to a
.
Related Pages¶
dyna
asize
acount
acap
afit
afree
apop
aend
alast
aclear
aset
arev
ahash
adel
astatic