ListSwapItems

Table of Contents

ListSwapItems

Description

Swap items at given indices.

Parameters

NameDirectionDescription
lin,outList to swap items in.
idx1inIndex/Position of first item.
idx1inIndex/Position of second item.

Success

v on success

Failure

NULL

Usage example (Cross-references)

    
    if (list->length > 1 && idx1 < list->length && idx2 < list->length) {
    ListSwapItems(list, idx1, idx2);
    }
    break;

Share :