1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
|
#include <iostream>
#include <fstream>
int main() {
std::ifstream file("test.txt", std::ios::binary | std::ios::ate);
while(file.tellg() > 0) {
file.seekg(-1, std::ios_base::cur);
int c = file.peek();
if(c > 0) {
std::cout << (char) c;
}
}
file.close();
return 0;
} |