Using C++, write a complete program called mycopy that uses the appropriate UNIX
ID: 3613227 • Letter: U
Question
Using C++, write acomplete program called mycopythat uses the appropriate UNIX system call(s) to:
· Report anerror if two command-line parameters are not given along with itsname mycopy. The error should be reported using the word"mycopy" and the standard system error message.
· Create anew file with the name given by the second filename.
· Copy thecontents of the file identified by the first filename into the newfile.
· Report thenumber of bytes copied.
(hint: use open (twice), read, write, close (twice), andeither count the bytes or use stat to determine the file size)
Explanation / Answer
//Hope this will help you. #include #include #include #include using namespace std; int main(int argc,char *argv[] ) { int count=0;char ch; if(argc != 3) { coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.