samedi 22 août 2020

Iterator and pointer in c++ [closed]

today i learned about vector but i am confused that why we can not store a reference of vector in pointer instead of iterator? i konw both are pointer but different type. why we use only iterator in vector. please tell me difference between iterator and pointer. how we can dereference iterator like pointers . why iterator is declared in different way. And also tell about begin function. is begin function return reference of first elements means address of first element.

Aucun commentaire:

Enregistrer un commentaire