ITP 165x Lecture 12: std_getLine, File I-O

41 views2 pages

Document Summary

Itp 165: intro to c++ - lecture 12: std::getline, file i/o std::getline() In the library, there is a function called std::getline. Std::getline allows you to get an entire line of input (so it doesn"t stop until an enter) The input stream you want to grab the line from (what"s an input stream?!) The string that you want to store the line in. A stream is just another word for something that we will either get text input from, or write text output to. So std::cout is an output stream that writes output to the console. Std::cin is an input stream that reads input from the console. (as we"ll see, there are potentially other input and output streams!) It needs to read and write to files we can do this with i/o streams that are specific to files. So instead of cin/cout, we"ll use different streams. The library handles streams for file input and output.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents