...
...
...
So cry about it. Come on show us some effort. How could it not help you and why are you not asking relavent questions if it didn't. Here's the exact program for what your's intended, straight from the site:
Code:
// reading binary file
#include <iostream>
#include <fstream>
const char * filename = "example.txt";
int main () {
char * buffer;
long size;
ifstream file (filename,
ios::in |
ios::binary |
ios::ate);
// ios::ate is end-of-file pointer
// so tellg will now give yield size
size = file.tellg();
file.seekg(0, ios::beg);
// dynamically allocate space
// on the "heap" if you will
buffer = new char [size];
// read() the file into your buffer
file.read (buffer, size);
// clean ........ up
file.close();
delete[] buffer;
return 0;
}