Skip to content

alen

Category: array
GitHub: cute_array.h


Returns the number of elements in the array.

#define alen(a) cf_array_len(a)
Parameters Description
x The x position of the window.
y The y position of the window.

Code Example

Creating an array, adding an element, then decrementing the count to zero before freeing the array.

dyna int a = NULL;
apush(a, 5);
CF_ASSERT(alen(a) == 1);
alen(a)--;
CF_ASSERT(alen(a) == 0);
afree(a);

Remarks

a must not by NULL. This function returns a proper l-value, so you can assign to it, i.e. increment/decrement can be quite useful.

dyna
asize
acount
acap
afit
apush
apop
aend
alast
aclear
aset
arev
ahash
adel
astatic
afree