hi
i write a QString array in a file in binary mode and then read it from the file. the code is below. for what is it read wrong? and is QString suitable for saving these names?
Qt Code:
  1. QString names[125];
  2. for(int i=0; i<125; i++)
  3. {
  4. names[i] = QString("Name%1").arg(i+1);//is QString suitable for saving these names?
  5. }
  6. QFile namef1;
  7. namef1.setFileName("names.bin");
  8. if(!namef1.open(QFile::ReadOnly))
  9. {
  10. qDebug()<<"can not open to read";
  11. }
  12. namef1.read((char*)names, 125*sizeof(QString));
  13. namef1.close();
To copy to clipboard, switch view to plain text mode 


Qt Code:
  1. QFile namef;
  2. namef.setFileName("names.bin");
  3. if(!namef.open(QFile::WriteOnly))
  4. {
  5. qDebug()<<"can not open to write";
  6. }
  7. namef.write((char*)names, 125*sizeof(QString));
  8. namef.flush();
  9. namef.close();
To copy to clipboard, switch view to plain text mode 
thanks for any help