C++
fstream fin;
fin.open(filename, ios::in);
if (!fin.good())
{
cerr<<"Failed to open "<<filename<<endl;
return -1;
}
fin.seekg(0, ios::end);
size_t len = fin.tellg();
char * raw = new char[len+1];
raw[0] = 0;
fin.read(raw, len);
fin.close();
printf("%s\n", raw);
delete raw;
C#