Understanding of auto keyword

what is auto and explain me in every case how it actually works

hello @TheSourabh

auto keyword detects the dataype of variable automatically.

so if u dont want to mention dataype of variable then u can simply put auto keyword.

for example->
if v is vector of int or string or any other datatype then
for(auto k : v ) { // this auto keyword will detect its type automatically

}

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.