Professional Documents
Culture Documents
Content Comp Sci
Content Comp Sci
Content Comp Sci
TEXT FILE
BINARY FILE
Files are used to store data in a device. C++ file handling provides a mechanism to
store output of a program in a file and read from a file on the disk.
A file can be opened in different modes to perform read and write operations. I have
used ios::out mode at various places in our program.
I have used binary files in the program to input information of each restaurant which
includes the name of the restaurant, menu of the restaurant and its rating.
CONCEPT USED
It is a user defined data type, which holds its own data members and member
functions, which can be accessed and used by creating an instance of that class. Data
members are the data variables and members functions are the functions used to
manipulate these variables and together these data members and member functions
defines the properties and behaviour of the objects in a class.
We used two inside-class functions which were char* rtnname(); and char*
rtncui(); which returns the name of the restaurant and cuisine respectively.
To define a member function outside the class definition we have to use the scope
resolution :: operation along with class name and function name.
Char item4[20];
Char item5[20];
These were declared as public members and hence can also be accessed from
outside the class with the help of functions.
Void showdata()
Void sort()
Void qty()
Char* rtnname()
Char* rtncui()