Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i open a file and read in one line at a time?

Status
Not open for further replies.

adi316

Programmer
Sep 10, 2002
35
CA
? tia
 
Opening

ifstream bookworm("ABook.txt");

Reading one line

string rope;
getline (bookworm, rope);

Closing

it closes when it goes out of scope.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top