#include <iostream>
#include <fstream>
using std::cout;
using std::endl;
using std::ifstream;
int main()
{
ifstream ifs("d:\\data.txt");
if (!ifs) {
cout << "Error open file" << endl;
return 1;
}
char ch;
long size;
ifs.seekg(0, std::ios::end);
size = (long)ifs.tellg();
size--;
for (int i = size; i >= 0; i--) {
ifs.seekg(i, std::ios::beg);
ifs.get(ch);
cout << ch;
}
cout << endl;
ifs.close();
return 0;
}
/*
run:
nohtyp ++c c
*/