for (vector::iterator it = vect.begin() ; it != vect.e
nd(); ++it)
cout << ’ ’ << *it;
Please explain the notations used. I am not very well-versed with vectors
hey @Bumblebee, it is actually a pointer that act as iterator similar to int i in for loop defination,
vect.begin() is function in vector.h that returns the address of first entry of vector.
vect.end() is function in vector.h that returns the address of last entry of vector.
As it is pointer to vector entry and we need value stored at that address we are using *it to get the value.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.