Reading a file with the contents "aaaaa" and the char* text returns "".
Following the step execution shows it going through the fp>>text line once before going over and ending. The file opens correctly. Any ideas?
char* Load_Wave_File(char *fname)
{
std::ifstream fp(fname,std::ios::binary);
std::streampos fsize=0;
fsize=fp.tellg();
fp.seekg(0,std::ios::end);
fsize=fp.tellg()-fsize;
char* text;
text=new char[fsize];
if(fp.is_open())
{
while(!fp.eof())
{
fp>>text;
}
fp.close();
return text;
}
else
{
fp.close();
return false;
}
}