qt code

C++ code posted by qt
created at 06 Jun 04:32

Edit | Back
1
2
3
4
5
6
7
8
 QFile file("box.txt");
 if (file.open(QFile::ReadOnly)) {
     char buf[1024];
     qint64 lineLength = file.readLine(buf, sizeof(buf));
     if (lineLength != -1) {
         // the line is available in buf
     }
 }
224 Bytes in 2 ms with coderay