what is this type of vector mean?

1. vector<int> path(1, 0); this looks weird. how to use this vector?
vector<bool> path(true,n)

vector<int> path(1, 0); creates a vector of integers which is initially filled with 1 element that has the value 0.

vector<bool> path(true,n); looks like it has the arguments passed in the wrong order. The first argument is supposed to be the number of elements and the second argument the value of the elements.

http://en.cppreference.com/w/cpp/container/vector/vector
Topic archived. No new replies allowed.