printArray()

Output / Text Area

Description

Prints the contents of a std::vector to the console with indices.

Syntax

void printArray(std::vector<T> a)

Parameters

NameTypeDescription
astd::vectorthe vector to print

Returns

void

Related

Under the Hood

From Processing.h:

template<typename T> inline void printArray(const std::vector<T>& a) { for (size_t i=0; i<a.size(); i++) std::cout << "[" << i << "] " << a[i] << "\n"; }