Problem with function rename()

Hello everybody, i have problem with 'rename()' function, take a look at the code

1
2
3
4
5
6
7
8
9
10
11

#include <cstdio>
#include <windows.h>

int main()
{
   rename("Database\\assm.txt", "C:\\mk.txt");

   return 0;
}   


When the program starts, it actually move the file, but the path is wrong,instead 'C:', the path is 'C:\Users\Chad\AppData\Local\VirtualStore'.
My c++ folder's location is on the dekstop, is this the problem?

Please help
Last edited on
Topic archived. No new replies allowed.