Sometimes, you may want to cut up files to make them transportable by floppy disk. I'm trying to write a program to do this, but it's not working, as usual :P Here's what I've got :
As you can see, I annotated it to see what happens, but I get no files written, and I get this continuing past the EOF...
void cut(char* filename, int filesizes)
fin.open(filename, ios::in | ios::nocreate);
t("File not found. Exiting program...");
string fileout = "";
int counter = 0;
int counter2 = 0;
counter2 = 0;
fin >> temp;
fileout += filename;
fileout += ".";
fileout += counter;
fileout += ".rps";
while(counter2 < 1024*filesizes)
cout << "1, ";
fout << temp;
cout << "ONE FILE WRITTEN ! --------------------" << endl;
If I explain my code : the user types in a filename, and a filesize for each of the smaller files to be. This size is in kilobytes, which is why I write out 1024 times this number, as I write out a byte at a time. Void t is simply a typewriter effect for cout. It's probably something I've missed, but I can't see it.
Thanks for your help.