for(auto it=s1.begin();it=s1.end();it++){
cout<<*it;
}
What is the significance of auto before pointer variable it?
please explain in detail
Some doubts in string class of c++
auto is used when we do not know what kind of iterator will be return to specified iterator. Auto is kind of placeholder it will be modified to whichever datatype its being used for(but this will happen once only at the time of initialization after that the variable will have fix datatype.)