hey now i'm pretty sure that i got this program perfect theoreticly, but it just wont work! It says virtual memory error when i run the coppied file. If anyone could tell me whats wrong or tell me how to do it any other way i'd appreciate it:

ifstream ifile;
ofstream ofile;
ifile.open("file.exe",ios::binary);
ofile.open("copyd.exe",ios::app);
while(!ifile.eof())
{
ifile.getline(storage,255);
ofile << storage;
}
ifile.close();
ofile.close();
---------------------------------
got any ideas? It looks like it works but it dosnt copy correctly i guess.(??)