If i initialize a std::vector
like this:
vector<int> sletmig(300);
will it set all the 300 values to zero, or keep what was in my computer memory?
If i initialize a std::vector
like this:
vector<int> sletmig(300);
will it set all the 300 values to zero, or keep what was in my computer memory?
They will be set to zero as the elements will be value-initialized.
From cppreference
But know that you can also specify the default value of all the elements, for example
Again from cppreference