+ 2
Hello everyone i have some Questions
Are there any commands in C++ to copy files or rename files? I want to know that because i want to write a programm to save some of my files on an external hard drive.
3 Answers
+ 3
Rename:
#include <stdio.h>
int main () {
char oldname[] ="oldname.txt";
char newname[] ="newname.txt";
int result= rename( oldname , newname );
if ( result == 0 ) puts ( "File successfully renamed" );
else perror( "Error renaming file" );
return 0;
}
+ 3
Copy file: too long, check this link for good answers
http://stackoverflow.com/questions/10195343/copy-a-file-in-a-sane-safe-and-efficient-way
+ 1
Thank you all :)