How exactly do I read a QString from a file outside of Qt? The file stores map data for my game I'm writing in Visual Studio. right now I'm simply trying to read the header that I wrote to the file first.

I'm using QDataStream to write it:
Qt Code:
  1. QString HeaderId("SME");
  2. qint32 version = 0;
  3. out << HeaderId << version;
To copy to clipboard, switch view to plain text mode 

I read in the reference that a QString is written as a qint32 so I tried to read it like this:
Qt Code:
  1. int32 HeaderId[3];
  2. int32 HeaderVersion;
  3.  
  4. fread( &HeaderId, sizeof( int32), sizeof(HeaderId), file);
  5. fread( &HeaderVersion, sizeof( int32), 1, file);
To copy to clipboard, switch view to plain text mode 

I'm getting a unhandled exception when it tries to read the version. How do I do this right?