mardi 8 décembre 2020

Why do I have to assign a size for a std::array, when a plain array doesn't have to be?

std::array<int, 3> foo = {1,2,3};
int bar[] = {1,2,3}; // the size is 3

For a plain array I don't have to assign the size. But I have to assign the size for std::array. Why?

Aucun commentaire:

Enregistrer un commentaire