MadPumpkin wrote:thank you for all of your help! everybody!! now, fantastico, about the filen.size() is there a way to do that so that i actually get the stream size instead of name of file?
MadPumpkin wrote:thank you for all of your help! everybody!! now, fantastico, about the filen.size() is there a way to do that so that i actually get the stream size instead of name of file?
ifstream is;
is.open("filename", ios::binary);
is.seekg(0, ios::end);
unsigned int length = is.tellg();
is.seekg(0, ios::beg);
char* buffer = new char[length];
is.read(buffer, length);
It should load the whole file into that byte array buffer and I guess it will work as long as the file size fits into that unsigned int and there is enough memory for new to succeed.