Page 403 - C++
P. 403

cin>>clas;
                cout<<"\n\n\t Enter The Section Of The Student : ";
                cin>>section;
                section=toupper(section);
                fstream file ,file2,file3,file4;
                file.open("fee.dat", ios::in|ios::binary);

                int flag=0;

                while(file.read((char *)&s, sizeof(s)))
                {
                        if(s.cls==clas)
                        {
                               flag=1;
                               break;
                        }

                }
                        if (flag==0)
                        {
                               cout<<"\n\t Please check the the input for class.......";
                               getch();
                               file.close();
                               return;
                        }

                file2.open("student.dat", ios::in|ios::binary);
                flag=0;
                while(file2.read((char *)&s, sizeof(s)))
                {
                        if(s.retno()==anum)
                        {
                               flag=1;
                               break;
                        }
                }
                if (flag==0)
                {
                cout<<"\n\n\t Please check the Admission no........";
                getch();
                file.close();
                file2.close();
                return;
                }
                long offset=0;
                file3.open("Sfee.dat",ios::in|ios::out|ios::binary);
                cout<<"\n\t Enter term     :  ";
                cin>>t;
                flag=0;
                while(file3.read((char *)&sf,sizeof(sf)))
                {
                        if (sf.retad()==anum && sf.retterm()==t)
                        {
                               flag=1;
   398   399   400   401   402   403   404   405   406   407   408