VecPopBack
- Macro
- August 22, 2025
Table of Contents
VecPopBack
VecPopBack
Description
Pop item from vector back.
Parameters
Name | Direction | Description |
---|---|---|
v | in,out | Vector to pop item from. |
ptr | out | Popped item will be stored here. Make sure this has sufficient memory to store memcopied data. If no pointer is provided, then it’s equivalent to deleting item from last position. |
Success
return
Failure
Does not return
Usage example (Cross-references)
- In
Remove.h:27
:
/// FAILURE : Returns NULL otherwise.
///
#define StrPopBack(str, chr) VecPopBack((str), (chr))
///
- In
Remove.h:135
:
/// FAILURE : Does not return
///
#define VecDeleteLast(v) VecPopBack((v), (VEC_DATATYPE(v) *)NULL)
///
- In
Vec.Remove.c:29
:
// Test VecPopBack function
bool test_vec_pop_back(void) {
printf("Testing VecPopBack\n");
// Create a vector of integers
- In
Vec.Remove.c:47
:
// Pop from the back
int popped;
VecPopBack(&vec, &popped);
// Check popped value
- In
Vec.Remove.c:61
:
// Pop again
VecPopBack(&vec, &popped);
// Check popped value