|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
C++
DETAILS
Question: What is an Iterator class?
Answer: A class that is used to traverse through the objects maintained by a container class. There are five categories of iterators: input iterators, output iterators, forward iterators, bidirectional iterators, random access. An iterator is an entity that gives access to the contents of a container object without violating encapsulation constraints. Access to the contents is granted on a one-at-a-time basis in order. The order can be storage order (as in lists and queues) or some arbitrary order (as in array indices) or according to some ordering relation (as in an ordered binary tree). The iterator is a construct, which provides an interface that, when called, yields either the next element in the container, or some value denoting the fact that there are no more elements to examine. Iterators hide the details of access to and update of the elements of a container class. The simplest and safest iterators are those that permit read-only access to the contents of a container class.
|
|
|
Category |
C++ Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 7234 users |
Added on |
7/16/2015 |
Views |
66881 |
Rate it! |
|
|
Question:
What is an Iterator class?
Answer:
A class that is used to traverse through the objects maintained by a container class. There are five categories of iterators: input iterators, output iterators, forward iterators, bidirectional iterators, random access. An iterator is an entity that gives access to the contents of a container object without violating encapsulation constraints. Access to the contents is granted on a one-at-a-time basis in order. The order can be storage order (as in lists and queues) or some arbitrary order (as in array indices) or according to some ordering relation (as in an ordered binary tree). The iterator is a construct, which provides an interface that, when called, yields either the next element in the container, or some value denoting the fact that there are no more elements to examine. Iterators hide the details of access to and update of the elements of a container class. The simplest and safest iterators are those that permit read-only access to the contents of a container class. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What is the use of ‘using’ declaration.
|
View Answer
|
|
When does a name clash occur?
|
View Answer
|
|
What is a modifier?
|
View Answer
|
|
Virtual Destructor - What is the need for Virtual Destructor
|
View Answer
|
|
What is output equal to in Bitwise Operations
|
View Answer
|
|
What’s the auto keyword good for?
|
View Answer
|
|
What does extern mean in a function declaration?
|
View Answer
|
|
What's the best way to declare and define global variables?
|
View Answer
|
|
How do you decide which integer type to use?
|
View Answer
|
|
How do you write a function that can reverse a linked-list?
|
View Answer
|
|
What is the difference between declaration and definition?
|
View Answer
|
|
What is the difference between realloc() and free()?
|
View Answer
|
|
How do you find out if a linked-list has an end? (i.e. the list is not a cycle)
|
View Answer
|
|
What is C++?
|
View Answer
|
|
What is the difference between declaration and definition?
|
View Answer
|
|
What are the advantages of inheritance?
|
View Answer
|
|
Tell how to check whether a linked list is circular.
|
View Answer
|
|
What is public, protected, private?
|
View Answer
|
|
Write a program that ask for user input from 5 to 9 then calculate the average
|
View Answer
|
|
What do you mean by inline function?
|
View Answer
|
Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.
View All C++ Interview Questions & Answers - Exam Mode /
Learning Mode
|