Rename a File - C File

C examples for File:File Operation

Description

Rename a File

Demo Code

#include <stdio.h>

int main()/*  w w  w . j a  v  a  2s . c  o m*/
{
     int m;
     m = rename("C:\\Code\\data.txt", "C:\\Code\\city.dat");
     if (m == 0)
         puts("Operation of renaming a file is successful.");
     if (m != 0)
         puts("Operation of renaming a file failed.");
     return(0);
}

Result


Related Tutorials