Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <fstream>
- using namespace std;
- struct grp_header {
- short frames, width, height;
- } grp;
- int main(int argc, char ** argv)
- {
- ifstream myGrp;
- myGrp.open(argv[1], ios::binary);
- if (myGrp.is_open()) {
- myGrp.seekg(0, ios::beg);
- myGrp.read((char *)&grp, sizeof(short) * 3);
- cout << "File was opened!" << endl;
- cout << "GRP has " << grp.frames << " frames" << endl;
- cout << "GRP has " << grp.width << " pixels width" << endl;
- cout << "GRP has " << grp.height << " pixels height" << endl;
- } else {
- cout << "File was not opened!" << endl;
- }
- myGrp.close();
- cin.clear();
- cin.ignore();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment