All pastes #1463333 Raw Edit

Someone

public cpp v1 · immutable
#1463333 ·published 2009-06-17 12:44 UTC
rendered paste body
#include <QtCore/QCoreApplication>#include <QFile>#include <QDataStream>#include <QDebug>#include <iostream>using namespace std;int main(int argc, char *argv[]){    QCoreApplication a(argc, argv);    QFile file("test.dat");    file.open(QIODevice::WriteOnly);    QDataStream out(&file);    out << "This is just some test string...";    out << (qint32)12;    file.flush();    file.close();    // ------------------------------------------------    QFile file2("test.dat");    file2.open(QIODevice::ReadOnly);    QString test01;    qint32 test02;    QDataStream in(&file2);    in >> test01 >> test02;    file2.flush();    file2.close();    // read the vars    qDebug() << "STRING: " << test01 << " NUMBER: " << test02 << endl;    return 0;}