what is the functionality of auto keyword as used in this vector introduction video??
Auto keyword functionality
hello @mahfoozhaque91
the auto keyword is used in place of the datatype to tell the compiler to infer the variable’s type on its own.
it deduces the datatype on its own , we dont have to explicitly mention the tyep.
for example->
for(int i : vectorName) { //here int is the dataype
something
}
we can write the same thing with the help of auto without explicitly mentioning the datatype
for(auto i : vectorName) { //repalced int with auto
something
}
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.