/* read a data from file2 until end of file reached */
#include
#include
main()
{
	typedef struct bio
	{
		char name[25];
		int age;
		char sex[7];
		char design[20];
		float salary;


	} BIO;
	BIO x;
	FILE *fp;
	clrscr();
	fp=fopen("file2","r");
	if(fp==NULL)
	{
		printf("file opening error");
		return;
	}
	while(feof(fp)==0)
	{
		fscanf(fp,"%s%d%s%s%f",x.name,&x.age,x.sex,x.design,&x.salary);
		printf("%s\t%d\t%s\t%s\t%f\n",x.name,x.age,x.sex,x.design,x.salary);
	}
	fclose(fp);
	getch();
}