CSCI 103L Lecture Notes - Lecture 11: Binary Search Algorithm, Natural Number

23 views2 pages

Document Summary

Two kinds of files: binary and text. Always just gets the next character after the le pointer fp. >> skips spaces and just gets data. get() gets just raw characters no matter what they are. getline() gets a while line: eof (end of le) character represents the end of the le. Could make a loop to grab a character until eof. I le will fail if you try to . get() on eof. good() returns false when . fail() returns true. Ifstream. seekg(: go to a particular location , 2nd argument is offset from position, ios_base::beg -> beginning, ios_base::cur -> current, ios_base::end -> end, ex: ifstream. seekg(ios_base::cur , 2) 2 past current. Ifstream. seekg(ios_base::end, -2) 2 back from the end: tellg() tells you how far along in the le you are, ex: ifstream. tellg() = 0 if you"re at the beginning of the le. How do you nd a word in a dictionary: describe an ef cient method.

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