Hi all,

Anyone knows how to write a c struct into Qfile and extract them?

below is a sample struct to be written to a file.

Qt Code:
  1. typedef struct user {
  2. Qstring user;
  3. QString pass;
  4. } user;
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. QFile mapfile(filename);
  2. mapfile.open(QIODevice::ReadWrite);
  3. //how to proceed from here?
To copy to clipboard, switch view to plain text mode