Hi.
I want to read a file and scan the file to see if the file contains 0x000001 (24 bits, 23 zero and 1 one bit). if file contains 0x000001, return a "yes", else return a "no".
I tried writing the program but cannot work. I am stuck with this for several days already.
This is an incomplete program. Can you pls help me out with this?
Thank you very much.
#include <iostream>
#include <fstream>
#include <stdio.h>
using namespace std;
int main() {
std::ifstream ifs("c:\\FT_student.pdf", std::ios::binary);
char buff[1024];
ifs.seekg (0, std::ios::beg);
int count = 0;
while(!ifs.eof()){
ifs.getline(buff,1024);
std::cout << count++ << std::endl;
}
cin.ignore();
cin.get();
return 0;
}