subset()

Data / Array Functions

Description

Extracts an array of elements from an existing vector.

Syntax

std::vector<T> subset(std::vector<T> arr, int start) std::vector<T> subset(std::vector<T> arr, int start, int count)

Parameters

NameTypeDescription
arrstd::vectorthe source vector
startintstarting index
countintnumber of elements (optional)

Returns

std::vector

Related