is it necessary to use auto variable with find function?
Regarding the find function
hey @aslesha.j7 it is not necessary if you know what find will return then you can declare that kind of iterator variable, for example if you want to use find with vector then vector::iterator can be used instead of auto.
is it the case that find only takes iterator variable?
Here is the return value of the find function
An iterator to the first element in the range that compares equal to val.
If no elements match, the function returns last.
Since find returns the iterator, it will only takes iterator values.
okay I got it thank you
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.