cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
ostream/istream iterators
ostream/istream iterators
May 20, 2013 at 2:06am UTC
Anmol444
(638)
How can they be classified as iterators?
http://en.wikipedia.org/wiki/Iterator
The Wikipedia definition says:
"In computer programming, an iterator is an object that enables a programmer to traverse a container."
So why are they classified as iterators cause they aren't really letting you traverse a container???
I tried to do some research but after 2 hours of pounding my head I came back to the forum. I am really confused now.
Can someone please help me!
May 20, 2013 at 3:21am UTC
Zhuge
(4664)
To put it simply, the iterators are letting you traverse the stream
as if
it were a container.
May 20, 2013 at 3:22am UTC
Anmol444
(638)
Oh ok, that makes sense. I shall go with that for now. Thanks!
May 20, 2013 at 3:24am UTC
kbw
(9488)
The cool thing about them is that they make input or output streams look like containers. That allows you to use the relevant standard algorithms to read/write them.
May 20, 2013 at 3:59am UTC
Anmol444
(638)
Thanks guys!
Topic archived. No new replies allowed.