struct employee
{
int id;
int name[30];
float sal;
}emp;
int main()
{
int i,n;
FILE *fwptr,*frptr;
//open file for writing
fwptr=fopen("emp.dat","wb");
// checking if file exists or not
if(fwptr==NULL)
{
printf("File doesn't exist");
return 0;
}
//Accepting number of records for writing
printf("How many records do you want?\n");
scanf("%d",&n);
0 comments: