Finding position in binary file using tellg()
CBSE12D-2016
Problem Statement - 04B
Write a definition for function ONOFFER( ) in C++ to read each object of a binary file TOYS.DAT, find and display details of those toys, which has status as “ÖN OFFER”. Assume that the file TOYS.DAT is created with the help of objects of class TOYS, which is defined below:
class TOYS { int TID;char Toy[20],Status[20]; float MRP; public: void Getinstock() { cin>>TID;gets(Toy);gets(Status);cin>>MRP; } void View() { cout<<TID<<”:”<<Toy<<”:”<<MRP<<””:”<<Status<<endl; } char *SeeOffer() { return Status; } };
Solution
CSKC| Created: 1-Jan-2019 | Updated: 1-Apr-2019|CBSE12A-2016