Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 698 Bytes

File metadata and controls

23 lines (20 loc) · 698 Bytes

Header only library for printing C++ containers such as vector and map

How to download library

Just download print.h and include it in your project

How to use

The library has only one function print which is under the namespace p

using namespace p

std::vector<int> veci{1, 2, 3};
print(veci);

Also works for deeply nested containers

std::vector<std::vector<std::vector<int>>> vecofvecofvecs = {{{1,2}, {1,4}}, {{2,5}, {4,2}}}
print(vecofvecofvecs);

Two optional parameters are available for specifying the delimiter and end character

print(std::vector<int>{1,2,3,4}, "-"); // 1-2-3-4
print(std::vector<int>{1,2,3,4}, "**", "|x"); // 1**2**3**4|x