Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
C++ Programming

Read a Text File

 

Top Ten Programs

Read a Text File
You can open a text file and read each line.

1. [ C++ ] Reading lines


Big

The text file haggis.txt includes some lines of text.

You read each line into a buffer s in this case the buffer size has been set to 1024 characters.