You might want to check if there is an error on your fstream before trying to print the char that youattempt to read:
1 2 3 4 5 6 7 8 9
std::ifstream ifs("data.txt");
char c;
if(ifs.get(c))
{
// only gets here if the read was successful
// (the file was opened and was not empty or non-readable etc...)
std::cout << int(c) << '\n';
}