Is int i we use in for loop is a iterator or not
Iterator in for loop
it is more of a counter or a generator, it is not defined in the iterator class of any DATA STRUCTURE but is used to traverse a container but that is not it’s primary purpose
consider for(int i=0;i<n;++i)cout<<i;
here it is not an iterator but just a counter variable
now consider for(int i=0;i<n;++i)cout<<arr[i]; this can be termed as an iterator but in reality it is not since i does not have a definition only attached with the array
now consider for(auto i = *arr ;i!-arr+n; ++i)cout<<i;
this is an iterator since it’s definition is bounded to the definition of the array and hence is an iterator of the array and not merely just a variable