CS 24000 Lecture Notes - Lecture 12: Iterator, Iter, Io Interactive

26 views2 pages

Document Summary

Interactive, file, and stream i/o: use istream for input and ostream for output, we have the following prede ned streams: istream cin; ostream cout, output operations. To output a variable use the << operator: modi ers include: Input operations: by default input operator >> skips whitespace chars; Input state to check the state of the input you can use: File streams cin. eof() - eof; cin. bad() - in error state cin. fail() - return true if last operation failed. To write to a le you use ifstream - input stream ofstream - output stream: containers, store elements of the same type. There exist two kinds of containers: sequential, used to represent sequences, associative, used to represent sorting collections. They associate a key to a data value set - sets with unique keys: map - maps with unique keys, multiset - sets with duplicate keys, multimaps - maps with duplicate. Iterators keys: an iterator supports at least the following operations:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents