im trying to solve this question
Write a C++ program that prints the file in reverse format character by character.
can anyone please tell me if im doing it correctly
Expand|Select|Wrap|Line Numbers
- #include <iostream>
- #include <conio.h>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream in ("file.txt");
- in.seekg(0,ios::end);
- int size=in.tellg();
- for (int j=1; j<=size; j++)
- { in.seekg(-j, ios::end);
- ch=in.get();
- cout <<ch;
- }
- in.close();
- getch();
- return 0;
- }