VecPopFront

Table of Contents

VecPopFront

Description

Pop item from vector front.

Parameters

NameDirectionDescription
vin,outVector to pop item from.
ptroutPopped 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.

Usage example (Cross-references)

    /// FAILURE : Returns NULL otherwise.
    ///
    #define StrPopFront(str, chr) VecPopFront((str), (chr))
    
    ///
    // Test VecPopFront function
    bool test_vec_pop_front(void) {
    printf("Testing VecPopFront\n");
    
    // Create a vector of integers
    // Pop from the front
    int popped;
    VecPopFront(&vec, &popped);
    
    // Check popped value
    
    // Pop again
    VecPopFront(&vec, &popped);
    
    // Check popped value

Share :