Use of auto in iteration

In this code during the printing of the string through iterator why we are using auto it and why not int it??
please elaborate this line.

@Nisha21
auto keyword ensures that the ‘it’ gets typecasted to whatever data type we try to print.
eg auto it : string --> it would be char
auto it : vector it would be int