hi
i am student and a begginer to c++..i dont know what to do regarding this problem i need help.please help me to solve my assignment.
Q:To Write a program in C++ that reads the name of a file as input and copies the contents of the file in reverse order (i.e. last line becomes first and so on) to another file . The program should also handle errors and give appropriate messages.?
i will be looking intently :?: for your help.

thanking you in anticipation
muaaz

Recommended Answers

All 2 Replies

Show me what you have so far.

simplest sequence (not recommended for large files) without error checking

read filename(s).
open file with given name for read-only
read entire file into buffer
close input file
open file for output as write-only
write buffer from the end one byte at a time
close output file

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.