C++ (Qt)QFile file("file.dat"); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; QString buf; while (!file.atEnd()) { buf = file.readLine(); }