Use of auto keyword

I was watching the first lecture on string class.
I have a doubt that while using iterators to iterate over all the characters of a string, what was the use of “auto” keyword in the for loop bracket. what does it mean?

hello @priyam04

auto is a keyword in c++ that detects the datatype of data automatically.

for example

for(char  x : stringName) {


} 
``
here in place of using char u can use auto , it will deduce its type on its own

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.