C++ (Qt)QVector<double> buf(len);file.read((char *)buf.data(), len * sizeof(buf[0]));buf[index] = 5.0;
QFile file("doubleInt.txt"); if(!file.open(QIODevice::WriteOnly)) qDebug() << "ERROR"; QDataStream streamToFile(&file); double doubleToFile = 2.6; streamToFile << doubleToFile; file.close(); if(!file.open(QIODevice::ReadOnly)) qDebug() << "ERROR"; QDataStream streamFromFile(&file); double doubleFromFile; int intFromFile; qint8 charFromFile; streamFromFile >> doubleFromFile; file.seek(0); streamFromFile >> intFromFile; file.seek(0); streamFromFile >> charFromFile; qDebug() << doubleFromFile; qDebug() << intFromFile; qDebug() << charFromFile;