#include<stdio.h>
#include<conio.h>
struct emp
{char name[20];
int id;
}e;
void main()
{ int vb;
FILE *pk=fopen("keviv.txt","a+");
clrscr();
if(pk==NULL)
{ printf("\n\n FILE DOES NOT EXIST");
getch();
exit(0);
}
while(1)
{ vb=fscanf(pk,"%s%d",e.name,&e.id);
if(vb==EOF)
break;
printf("\n\n Name: %s\n ID: %d",e.name,e.id);
}
fclose(pk);
getch();
}
Comments
Post a Comment