vector<uint8_t> File saving
-
i have a vector<uint8_t> and i want to save it to a file , here is my code in my button ,
QString text =ui->plainTextEdit->toPlainText(); string x=text.toStdString(); string Result=Huffman_encoding(x); vector<uint8_t> Result2=toBinary(Result);
thx in advance
-
@Zeyad-Khaled
UseQFile
to save any data to a file, type does not matter.Depending on your intentions, maybe (or maybe not) wrap it in a
QDataStream
.You use just about nothing which is Qt code, so you could equally go use the
iostream
/fstream
library methods instead. -
And why do you open a new thread even it's the same like here https://forum.qt.io/topic/132871 (and the deleted one from you before this)?
-
@Christian-Ehrlicher Because i Used Another Code and iam Completly new to Qt And there is'nt that much tutorial about this framwork
-
@Zeyad-Khaled said in vector<uint8_t> File saving:
there is'nt that much tutorial about this framwork
WHAT
Qt is one of the most documented frameworks I worked with. And I had to deliver in Object Pascal, Delphi, Python and Qt C++, among abominations like typescript/js/node. -
@Zeyad-Khaled You already found QFile::write() - so why can't you pass the pointer and length to this function? Don't see what this has to do with Qt...