Friday, July 31, 2009

Write a program in C++ that emulates the DOS COPY command i.e. it should copy the contents of a character fil?

Write a program in C++ that emulates the DOS COPY command i.e. it should copy the contents of a character file (such as any CPP file) to another file. Invoke the program with two command line arguments – the source file and the destination file – like this





C%26gt;ocopy srcfile.ext destfile.ext





In the program check that the user has typed the correct number of command line arguments, and that the file specified can be opened. Improve on the DOS TYPE command by having the program signal an error if destination file already exist. This will prevent inadvertently writing over a valuable file (Hint: Use no replace flag)

Write a program in C++ that emulates the DOS COPY command i.e. it should copy the contents of a character fil?
Do your own homework. That's about the simplest program someone could write.


No comments:

Post a Comment