#include #include using namespace std; int main() { char version [30]; char none[1]; char length[4]; /* This is supposed to read a Guitar Pro-file using the description at http://dguitar.sourceforge.net/GP4format.html. Maybe I've done some things wrong since I'm still a file reading beginner. */ // Opening the stream. fstream file("test.gp4",ios::in|ios::binary); // The first 30 characters declare the version information. // I don't know why there is a % after, why is that? file.get(version, 30); cout << "File version: " << version << endl; // Then we have a null byte, I haven't really looked up a way to ignore yet so this is // my temp solution file.get(none, 1); // Now there should be a 4 byte integer telling us how long the following string is+1. // Since I know which GuitarPro-file I am using this value should be 13. file.get(length, 4); cout << "Length of title: " << length << endl; // But it's empty. Why is that? file.close(); return 0; }