#include<stdio.h>
struct anik
{
char nm[100];
int id;
char cn[20];
};
int main()
{
FILE *rob;
rob = fopen("ac.txt", "r");
struct anik m;
if(rob == NULL)
{
printf("File does not exist\n\n");
}
else
{
printf("File is open\n\n");
while(fread(&m, sizeof(m), 1, rob)>0)
{
printf("Name : %s\nID : %d\nContact Number : %s\n\n", m.nm, m.id, m.cn);
}
fclose(rob);
}
return 0;
}
Comments
Post a Comment