Posts Tagged ‘reading’

Reading from a file in C++

Posted: 27th September 2010 by Tim in C++
Tags: , , , , , , , , ,

Reading data from a file is common in programming. C++ makes this process fairly painless with the ifstream class. When combined with the string class, you can avoid the memory and buffer overflow issues which you would have to deal with in C. The following example opens a file named “myfile.txt” and prints out each […]