It must be pure c++, I know about system("copy c:\\test.txt d:\\test.txt"); but I think it’s the system function, not c++ solution, or I can mistakes?
It must be pure c++ , I know about system( copy c:\\test.txt d:\\test.txt );
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about
std::fstream? Open one for reading and another for writing, and usestd::copyto let the standard library handle the copying.Something like this: