why it’s giving a compilation error ?
Auto keyword usage
auto won’t work with array as when we do auto x : (any dataType Container) it should have a begin and an end as well , which in case of array is not defined. So to print array you have to use classic for loop but for dataType Containers like vector set map you can use auto to iterate.
The real reason is this:
You can read this for better clarification.
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.