Voici ce que tu peux faire:
bool RetrieveDataFromFile(char * FileName)
{
std::ifstream Input;
unsigned long FileSize;
// Open the specified file
Input.open(FileName,std::ios::binary);
if(Input==NULL)
return false;
// Get file size
Input.seekg(0,std::ios_base::end);
FileSize=Input.tellg();
Input.seekg(0,std::ios_base::beg);
// Allocate some space
if(m_Data)
{
delete [] m_Data;
m_Data=NULL;
}
m_Data=new unsigned char[FileSize];
if(m_Data==NULL)
{
Input.close();
return false;
}
// Read the file into memory
Input.read((char*)m_Data,FileSize);
// End
Input.close();
return true;
}
Buno
----------------------------------------
L'urgent est fait, l'impossible est en cours. Pour les miracles, prévoir un délai...
Le site de mon mariage