#include<stdio.h>
#include<conio.h>
{
char filename[20];
char oldfilename[20],newfilename[20];
printf("\n Enter the file name to be removed: ");
gets(filename);
if(remove(filename)==0)
printf("File %s is removed",filename);
else
printf("File %s cannot be removed",filename);
printf("\n Enter old file name: ");
gets(oldfilename);
printf("\n Enter new file name: ");
gets(newfilename);
if(rename(oldfilename,newfilename)==0)
printf("\n File %s is renamed to %s",oldfilename,newfilename);
else
printf("\n file %s cannot be renamed",oldfilename);
getch();
}
Hey I want a program that writres in info.dat file
ReplyDelete