an iterator is just a pointer to a string. and you are'nt being clear. why based on the fact that you can do str.begin()+6 should you not have to use iterators?
The thing i am confused about if iterator is just a pointer than wouldn't it be correct just to have string *inpIt1=str.begin()+6;
is iterator just used to have genracity in program ?
than wouldn't it be correct just to have string *inpIt1=str.begin()+6;
No, it is not a pointer to string. It's a pointer to internal data. So it'd rather be char *.
On the other side: it's an iterator. All you need to know is that it obeys some according rules.
i apologize... my mistake. i havent built a container in a while. yeah its not actually a pointer to a string. its a pointer to what the class basic_string<char> contains.