Recently, I've started learning vector. I can't understand a syntax in vector. I googled it but couldn't find any satisfied answer.
std::vector<int> path;
std::vector<int> newpath(path);
Can anyone explain this?
Recently, I've started learning vector. I can't understand a syntax in vector. I googled it but couldn't find any satisfied answer.
std::vector<int> path;
std::vector<int> newpath(path);
Can anyone explain this?
The second line copy-constructs a new std::vector<int>
instance from path
. Thereafter both vectors store identical data.