problems with read binary file

I need to read binary file. I find some docs and try to do that. And I have 2 questions

  1. I used example code from docs and I've got error

`

include

include

include <stdlib.h>

using namespace std;

int main(int argc, char** argv)
{
ifstream infile;
int x;
infile.open("E:\file.bin",ios::binary|ios::in);
infile.read(&x,sizeof(x)); // <- error is here
return 0;
}
`

[Error] no matching function for call to 'std::basic_ifstream::read(int*, long long unsigned int)'

  1. What is the better way to find sequence of bytes ?
    For example the usefull information in binary file begin with bytes 'FF 04 45' and another '56 FD'
    How I can get this data ?

Thanks at advance

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories