The first question which i need to ask is
Do u know how the stack works. If not you need to go through it and understad how it works
But here is a brief description.
This way you can reverse the over all file. And for your function don’t use strrev function, that’s not a standard function
1. Start reading every word from the file.
2. Push the read word on to the stack.
3. Read the step 1 and 2 till you reach EOF
4. Come reached EOF. Pop the work which is on top of the stack
5. Print word.