Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  f
Language: C/C++
Code:
#include <stdio.h>

int main ()
{
   int ret;
   char oldname[] = "file.txt";
   char newname[] = "newfile.txt";
   
   ret = rename(oldname, newname);
     
   if(ret == 0) 
   {
      printf("File renamed successfully");
   }
   else 
   {
      printf("Error: unable to rename the file");
   }
   
   return(0);
}
Comments: