Code Snippets C

#include
int main ()
{
int result;
char oldname[] ="oldfile.txt";
char newname[] ="newfile.txt";
result= rename( oldname , newname );
if (result != 0 )
perror( "Error renaming file" );
return 0;
}