#include <stdio.h> int main () { int result; char oldname[] ="old.txt"; char newname[] ="new.txt"; result= rename( oldname , newname ); if (result != 0 ) perror( "Error renaming file" ); return 0; }