Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- using namespace std;
- int main()
- {
- char oldname[] = "ab.txt";
- char newname[] = "as.txt";
- if (rename(oldname, newname) != 0)
- perror("Error renaming file");
- else
- printf("File renamed successfully");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment