Question: Which of the following is a true statement about the difference between pointers and iterators?

  1. While pointers are variable that hold memory address, iterators are generic functions used to traverse containers. These function allows the programmer to implement read and write code as the container is traversed.
  2. Incrementing an iterator always means access the next element in the container(if any), no matter the container. Incrementing the pointer means pointing to the next element in memory, not always the next element.
  3. Pointers are variables that hold memory address where as iterator are unsigned integers that refers to offsets in arrays.
  4. All iterator are implemented with pointers so all iterators are pointers but not all pointers are iterators.

Answer: The correct answer of the above question is Option B:Incrementing an iterator always means access the next element in the container(if any), no matter the container. Incrementing the pointer means pointing to the next element in memory, not always the next element.