vendredi 12 août 2022

Does resize on a std::vector

Consider

#include <vector>
int main()
{
    std::vector<int> foo;
    foo.resize(10);
    // are the elements of foo zero?
}

Are the elements of foo all zero? I think they are from C++11 onwards. But would like to know for sure.

Aucun commentaire:

Enregistrer un commentaire