mardi 22 septembre 2020

Is it safe to access myvect[0]?

I have declared a vector vector<int> myvect; I am performing push_backs into the vector. Is it okay to do a cout<<myvect[0]; ?

Is it better to use iterators? Given the fact that I haven't mentioned the size of myvect initially.

Aucun commentaire:

Enregistrer un commentaire