Hi I need to make multiple copies of a file using Dev-C++ can anyone help?
CodeBoy101
-2
Junior Poster in Training
Recommended Answers
Jump to Postjust write it multiple times using a different filename each time. Or write the first file then call os-specific command to make additional copies.
Jump to Postwhy do you think CopyFile won't work for you? Its one of the easiest win32 api functions you can use.
for(i = 0; i < NumberFiles; i++) { CopyFile(OriginalFilename, filename[i], FALSE); }
Jump to Post> -- invalid conversion from `const char' to `const CHAR*'--
The [n] subscript is doing that.You need to generate the filename string, with n appended, before you pass it to CopyFile().
In C, I'd use say sprintf(), but in C++ I think a string stream would be more …
All 9 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
Salem
5,138
Posting Sage
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
CodeBoy101
-2
Junior Poster in Training
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
CodeBoy101
commented:
perfect!
+1
CodeBoy101
-2
Junior Poster in Training
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.