I'm having a problem reading in a binary file.
Here's my snippet of code I'm trying to work with
I'm trying to get help out of some books and some online help sites, but haven't gotten anywhere with those.
using namespace std;
static unsigned short read_array;
//Tag directory of file
const char *file1 = "/home/my_name/programs/InputFile.ima";
//Set input file reading
fstream reader(file1, ios::in | ios::binary);
cout << "\nFile doesn't exist\n" << endl;
istream &read(read_array, 25198320);
(i.e. I have no idea what I'm doing )
So, I'm trying to just read in data from a 50 MB binary file, and to store all the data in the array before I do anything else.
I get this with the code above
error: invalid initialization of non-const reference of
type 'std::istream&' from a temporary of type 'int'
I've tried to change the array to type char, but that hasn't worked either. It really doesn't like that istream &read line. Other than that, the file initialization part seems fine.
Anyone have any ideas? That would help alot